Commit Graph

5904 Commits

Author SHA1 Message Date
Matthias Beyer eed577db15 Add trace!() call to show config when runtime initializes
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11 03:22:56 +01:00
Matthias Beyer c8e74193b3 Optimize: Do not attempt to print if output is a pipe
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-11 03:22:56 +01:00
Matthias Beyer f1a639ea8c Change id reporting API to return ExitCode
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-11 03:22:56 +01:00
Matthias Beyer 19912f5e88 Add Is::remove_isflag() for removing header flags
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11 03:22:56 +01:00
Matthias Beyer 96a25c18b2 doc: Rewrite imag-mail documentation
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10 17:14:48 +01:00
Matthias Beyer 73d8d54528 doc: Add notes on CLI conventions
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10 17:14:45 +01:00
Matthias Beyer 5775a3461a doc: Add note that sorting in collections is no hard rule
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10 17:14:42 +01:00
Matthias Beyer de8e065eec doc: Rewrite docs for todo module parts
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10 17:14:21 +01:00
Matthias Beyer 03e0864268 Merge branch 'unnamed-annotations' into master-ff
This merge adds several patches to improve libimagannotation and
imag-annotate.
2019-02-10 17:07:35 +01:00
Matthias Beyer 53022443ab Rewrite iteration
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-10 01:00:38 +01:00
Matthias Beyer d8cd10a384 Remove iterator types
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-10 01:00:33 +01:00
Matthias Beyer c84258da3d Add flag to not print name of annotation
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10 00:58:21 +01:00
Matthias Beyer ab5078f111 Rewrite "add annotation" command
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-10 00:58:21 +01:00
Matthias Beyer ed01f8b463 Make annotations unnamed (automatically UUID named)
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-10 00:58:21 +01:00
Matthias Beyer d936b611fc Fix config override mechanism
The bug was that we did not actually _set_ the new value.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10 00:47:41 +01:00
Matthias Beyer 0f32471a03 Merge branch 'runtime-io-features' into master-ff 2019-02-09 23:42:09 +01:00
Matthias Beyer 84aef82258 Fix: "status" subcommand might not be present
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-09 01:03:34 +01:00
Matthias Beyer e25cf17a8a Fix: We go to the next month, not to the current one
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-09 01:03:32 +01:00
Matthias Beyer 340dab18f0 Fix: 'start-time' cannot be None
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-09 01:03:32 +01:00
Matthias Beyer afe275692e Fix: Do not use deprecated StoreId::exists() function
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-09 01:03:28 +01:00
Matthias Beyer e4ef6f0649 Remove log-destination-override features
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-05 01:03:39 +01:00
Matthias Beyer 4c0baa58f4 Add argument forwarding for --ignore-ids
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-05 00:59:30 +01:00
Matthias Beyer 3fbfb19419 Add runtime feature: Ignore id reporting
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-02-05 00:55:30 +01:00
Matthias Beyer b010d69e62 Update rustc
We need 1.31 because some dependencies use the new clippy macros.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-01-03 18:41:36 +01:00
Matthias Beyer 9185abcfa5 Update copyright years
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-01-03 18:41:36 +01:00
Matthias Beyer 4fe7fd366c Add Store::exists() for checking whether a StoreId exists as Entry
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-12-13 22:49:33 +01:00
Matthias Beyer ccd8e94fbf Update travis rustc version
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-13 22:49:08 +01:00
Matthias Beyer 37ac37f22e Merge branch 'minor' 2018-12-03 01:09:03 +01:00
Matthias Beyer 115002971d travis: Update rustc
because `encoding-rs` seems to need 1.29 as minimum version of the rust
compiler.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-26 20:16:35 +01:00
Matthias Beyer d70a97191c Simplify Display impl for Storeid 2018-11-26 18:21:28 +01:00
Matthias Beyer 1ce780795a Do not use StoreId::local() here 2018-11-26 18:19:10 +01:00
Matthias Beyer dd388e53bb Reimplement StoreId::to_str() without erroring
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-26 18:15:08 +01:00
Matthias Beyer 49b0b3a414 Merge branch 'forbid-unsafe'
With this merge, there is no longer unsafe code in the imag repository.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-11 14:28:04 +01:00
Matthias Beyer 496c06d15a Update lazy_static to 1.2
1.2 of lazy_static brings functionality to have no panics in the code,
which is what we try to have.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-11 13:05:55 +01:00
Matthias Beyer 9fca66aa89 Forbid unsafe code in all crates 2018-11-11 13:05:55 +01:00
Matthias Beyer 4e516ee19d Update version strings
...for the next release, which will be imag 0.10.0!

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-10 11:56:37 +01:00
Matthias Beyer 4fd2feb6f3 Merge branch 'prepare-0.9.0'
This merge marks the release 0.9.0 of the imag distribution.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-10 10:01:12 +01:00
Matthias Beyer 17d4123898 Update dependencies from git versions to proper versions.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-09 22:14:11 +01:00
Matthias Beyer dfba366a89 Add changelog for 0.9.0
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-09 22:14:11 +01:00
Matthias Beyer 47707bf593 Merge branch 'minor' 2018-11-09 22:11:39 +01:00
Matthias Beyer ed08e2ccf9 Update examples
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-09 21:48:26 +01:00
Matthias Beyer 093363f7e1 Add end-date for vacation
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-09 21:48:26 +01:00
Matthias Beyer 332fd5dd8b Remove code of conduct, we use the Rust CoC.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-09 21:48:26 +01:00
Matthias Beyer b3b32077a5 Remove empty section
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-09 21:48:26 +01:00
Matthias Beyer 35291d68ad Make code more idomatic
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-09 21:48:26 +01:00
Matthias Beyer a2eae99a39 Rewrite debug calls with DebugOption extension 2018-11-09 21:48:26 +01:00
Matthias Beyer 2cb46597f7 Add Option extensions for logging optional values
This patch adds the same extensions that we already have for
Result<T, E> also for Option<T>.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-09 21:48:26 +01:00
Matthias Beyer c767e6239e Remove unused parameter
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-09 21:48:26 +01:00
Matthias Beyer 9cfa9fc399 Make code more idomatic
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-09 21:48:25 +01:00
Matthias Beyer ed469f622a Make code more idomatic
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-09 21:48:02 +01:00