summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2019-02-15Move to simpler implementation of StoreidMatthias Beyer
This changes the implementation of the StoreId type to be less complex. Before we always had to re-attach the path of the store itself each time a StoreId object was passed to the store. Now we do not do this anymore, hopefully we can move to a implementation of the Store API which takes references of StoreId objects in the future. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15Fix: Off by one errorMatthias Beyer
When printing the error chain, we print the error and then iterate over the causes. Hence, we have to increase the printed number by one here, because 0 (zero) is already printed. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15Fix: Also print if runtime ignores IDsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15Add debug outputMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15Bugfix: Rebuild iterator when changing collectionMatthias Beyer
This patch fixes a bug where the following code (here pseudocode) did the wrong thing: store.entries().in_collection("foo").for_each(||...) because the `.in_collection()` call for the underlying PathIterator object did not actually re-build the iterator. It only changed the contained `PathIterBuilder`, but did not call `.build_iter()` on it to rebuild the iterator object. The test added with this patch checks whether the iterator does the right thing. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-12Do not use deprecated way of checking whether path existsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Fix negation errorMatthias Beyer
We Iterator::filter here, so we have to negate - because we list everything where _no_ instance exists yet. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Add debug outputMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Adapt for new interface of gen_vars() functionMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Make generate_variants() more flexibleMatthias Beyer
This patch changes generate_variants() so that it allows to be passed an iterator for the modders, which makes it more powerful for passing references.
2019-02-11Optimize: Do not iterate over entries outside of "timetrack" collectionMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Do not print table if table is empty anywaysMatthias Beyer
When listing timetrackings, we do not want to print an empty table if there aren't any timetrackings. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Add wrapping functionality for imag-logMatthias Beyer
This patch adds a wrapping functionality to imag-log. The commandline parameter `-w` or `--wrap` can not be used to wrap the output at N characters, defaulting to 80 characters. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Add feature to trim content on the rightMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Strip whitespace on the right when printingMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Remove magic constants in trace_unwrap_exit/map_err_trace_exit_unwrap callsMatthias Beyer
This patch removes the magic constant we used when calling `trace_unwrap_exit()` or `map_err_trace_exit_unwrap()`. We used to call it with `1` as parameter, where the number was the exit code to use. Now the implementation of the function does it automatically (using 1 (one) as exit code). All calls of these functions were fixed. Thanks to vim this was easy. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Remove clone() callsMatthias Beyer
We should be able, from the signature of the `generate_variants()` helper function, to pass a `Vec<&T>` here, so cloning should not be necessary. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Make doc comment test executableMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Simplify implementationMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Simplify implementation of Wiki::all_ids()Matthias Beyer
This way we alter the underlying iterator for all wiki entries to only iterate in the "wiki" collection of the store, which results in fewer disk access because the internal iterator does not yield all pathes from the store before filtering them. Code which was used to implement the filter was removed (also from the public interface of the library). Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Simplify implementation of ContactStore::all_contacts()Matthias Beyer
This way we alter the underlying iterator for all contacts to only iterate in the "contact" collection of the store, which results in fewer disk access because the internal iterator does not yield all pathes from the store before filtering them. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Add trace!() call to show config when runtime initializesMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Optimize: Do not attempt to print if output is a pipeMatthias Beyer
This is a small optimization so that we do not print the information if the output is a pipe anyways. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Change id reporting API to return ExitCodeMatthias Beyer
Because this API only errors when write!() errors occur, we can return the exit code as an error here. This way the user of the API can immediately exit if there was an IO error, but the API automatically takes care of the right return value, returning (exiting) with zero (0) if there was an "Broken pipe" error and with one (1) otherwise, which is the expected behaviour here. All calls to that API were changed accordingly. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11Add Is::remove_isflag() for removing header flagsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10doc: Rewrite imag-mail documentationMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10doc: Add notes on CLI conventionsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10doc: Add note that sorting in collections is no hard ruleMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10doc: Rewrite docs for todo module partsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10Merge branch 'unnamed-annotations' into master-ffMatthias Beyer
This merge adds several patches to improve libimagannotation and imag-annotate.
2019-02-10Rewrite iterationMatthias Beyer
This patch rewrites how imag-annotate iterates over the ids to process to be more easily to understand. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10Remove iterator typesMatthias Beyer
With this patch, libimagentryannotation does not have special iterator types anymore. This makes the whole thing more comfortable to use. In imag-annotate, the parameter for the functioncall was removed. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10Add flag to not print name of annotationMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10Rewrite "add annotation" commandMatthias Beyer
Because before we created a new annotation for each ID to be annotated, which is not the expected behaviour. Now we create one annotation object and then link it to all IDs which are provided on the commandline. Also, the annotation name is printed. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10Make annotations unnamed (automatically UUID named)Matthias Beyer
It makes no sense to name annotations, a user only cares about whether there are annotations or not, or their contents. A name has no meaning in this context. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10Fix config override mechanismMatthias Beyer
The bug was that we did not actually _set_ the new value. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-09Merge branch 'runtime-io-features' into master-ffMatthias Beyer
2019-02-09Fix: "status" subcommand might not be presentMatthias Beyer
If we call 'imag-habit' without a subcommand, we assume "today". Thus it might occur that the "status" subcommand match is not present, hence we have to assume `false` here as default value. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-09Fix: We go to the next month, not to the current oneMatthias Beyer
The filter filters from now to the first second of the next month, not the first second of the current month. Hence we have to add one here. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-09Fix: 'start-time' cannot be NoneMatthias Beyer
The UI is configured to require the 'start-time' parameter, so we do not need to check for None here. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-09Fix: Do not use deprecated StoreId::exists() functionMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-05Remove log-destination-override featuresMatthias Beyer
This removes the feature to be able to override log destinations from the commandline. This feature is removed because the --override-config feature from the runtime already contains this functionality. It is a little more complex to use, though this is a feature hardly used at all, so I rather go for less code (less complexity) here than feature bloat. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-05Add argument forwarding for --ignore-idsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-05Add runtime feature: Ignore id reportingMatthias Beyer
This feature gives the users of the Runtime API the possibility to check whether the user wants the ID reporting to be ignored as well (and more important) to override the default behaviour where the runtime assumes that if STDOUT is a pipe, it is a pipe to an imag command. Before, this would not have been possible: imag contact find Jonas --json | jq 'map(.fullname)' because the runtime automatically prints the output of the command to stderr and the touched IDs to stdout. But now with this change, a user can override this default behaviour and do: imag contact --ignore-ids find Jonas --json | jq 'map(.fullname)' Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-01-03Update rustcMatthias Beyer
We need 1.31 because some dependencies use the new clippy macros. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-01-03Update copyright yearsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-12-13Add Store::exists() for checking whether a StoreId exists as EntryMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-12-13Update travis rustc versionMatthias Beyer
1.29.x does not work anymore because a dependency fails to compile with it. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-12-03Merge branch 'minor'Matthias Beyer
2018-11-26travis: Update rustcMatthias Beyer
because `encoding-rs` seems to need 1.29 as minimum version of the rust compiler. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>