Commit Graph

5904 Commits

Author SHA1 Message Date
Matthias Beyer daaa4fd9ca Make assert!() output more verbose
By printing the actual `Result<>` object that failed the assertion.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-06 18:17:46 +01:00
Matthias Beyer d982a657f8 Rewrite Debug for FileLockEntry
This changes the implementation of Debug for the FileLockEntry to be
more explanatory of how the entry actually looks like. It does not only
print the path of the store anymore, but also the location of the Entry.

Printing header and content would be still too much, tho.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-06 18:12:58 +01:00
Matthias Beyer 17913ae3fd Optimize implementation: Less matches
This patch simplifies the code to be not three nested matches but rather
one match and then some function chaining.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-06 14:48:49 +01:00
Matthias Beyer 1321f49428 Optimize implementation
Code-wise, the functionality was not changed. The changes only make the
code much more pretty.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-06 14:48:49 +01:00
Matthias Beyer d004c667fd Optimize implementation
Code-wise, the functionality was not changed. The changes only make the
code much more pretty.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-06 14:48:49 +01:00
Matthias Beyer 5210985bf4 Optimize implementation
This does optimize the implementation of the list command implementation
(code-structure wise, not performance wise).

Functionality not altered.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-06 14:48:49 +01:00
Matthias Beyer e043304767 Add FileLockEntry-getter in Mail struct 2018-11-06 14:48:49 +01:00
Matthias Beyer e919435504 Fix: Remove call to deprecated function 2018-11-06 14:48:49 +01:00
Matthias Beyer cb0fcaffde Remove logging calls in favour of debug calls
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 21:35:40 +01:00
Matthias Beyer b4068bad0e Remove println call
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 21:33:18 +01:00
Matthias Beyer 1347784898 Merge branch 'safe-output'
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 21:22:26 +01:00
Matthias Beyer 4756811e35 Merge branch 'minor'
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 21:22:00 +01:00
Matthias Beyer a45691ef27 Change test output to use debug!() 2018-11-01 20:37:02 +01:00
Matthias Beyer 1f5b490dd7 Change test output to use debug!() 2018-11-01 20:37:02 +01:00
Matthias Beyer 83876b7c2c Change test output to use debug!() 2018-11-01 20:37:02 +01:00
Matthias Beyer f01a262bdf Add debugging output in test via logger 2018-11-01 20:37:00 +01:00
Matthias Beyer 3bf3a8890b Add debugging output in test via logger 2018-11-01 20:36:46 +01:00
Matthias Beyer 089d5b98cb Use error output from runtime to print error 2018-11-01 20:36:34 +01:00
Matthias Beyer afeb4031ac Use runtime provided error stream
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 20:34:58 +01:00
Matthias Beyer 8223f846b4 Use new "ask" function interface with input/output stream params
In the imag-contact crate we had to rewrite the ask_continue!{} macro
as a function for less headache, but besides that this is a rather
straight-forward patch for adapting to the new interface.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 20:33:24 +01:00
Matthias Beyer 91f5a33f5a Make "ask" functions get input and output streams
This way we can control where the input comes from and the output goes
to (like we want to with libimagrt).

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 20:30:12 +01:00
Matthias Beyer 993f83a31b Print Runtime errors to stderr 2018-11-01 20:26:25 +01:00
Matthias Beyer ea7c239e1f Merge branch 'fixes'
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 13:59:57 +01:00
Matthias Beyer 7f0d5b8bfd Do not pass --rtp in test runtime 2018-11-01 13:19:14 +01:00
Matthias Beyer 71086b67d8 Add debug output in test runtime generating macro 2018-11-01 13:18:58 +01:00
Matthias Beyer 32f38945f0 Fix tests: Do not pass "internal", subcommand does not exist anymore 2018-11-01 13:15:19 +01:00
Matthias Beyer e39bd7fc72 Merge branch 'fix-flag-forwarding'
Conflicts were handled manually.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 00:09:54 +01:00
Matthias Beyer 1a1cc885cc Merge branch 'rt-remove-default-value-verbosity'
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 00:05:42 +01:00
Matthias Beyer 9978bce622 Merge branch 'runtime-logging-init-imag'
This merge adds logging capabilities to the `imag` binaries.

For this, the libimagrt had to get a new compiletime feature which makes
the logging initialization public for this usecase.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 23:33:46 +01:00
Matthias Beyer 351849e349 Fix: Remove default value for --verbose flag
This actually caused an error.

When executing `imag ids --verbose trace` for example, the `imag` binary
got the default value (as in `--verbose info`) supplied from clap. So
far, so good. Problem is that the implementation then forwarded that
flag to `imag-ids`, which resulted in the `--verbose` flag to be passed
_two times_ to `imag-ids`.

Somehow this is really strange, but it does not really matter. First of
all: A default of "Info" is still too high IMO. Default should be
warnings and errors, but no information printed. We like silent tools,
don't we?

Second is that the commandline argument forwarding mechanism of `imag`
is broken and this was a fix which helped debugging of the brokenness,
so this is acutally a step forward in this regard as well.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 23:13:07 +01:00
Matthias Beyer 25ee6f2ce4 Fix: Forward flags as well
This is a bugfix. The old implementation did not forward simple
commandline flags (as in `--debug`, arguments with no value) because it
only used `ArgMatches::value_of()`. But if there is no value, the method
returns `None` and the flag is not forwarded.

This patch fixes that issue.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 23:12:35 +01:00
Matthias Beyer c4c52e43a6 Add some debugging output 2018-10-31 23:11:06 +01:00
Matthias Beyer 9636cef7a8 Print (debugging) CLI when initializing runtime
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 23:11:06 +01:00
Matthias Beyer e4ffeddf85 Use libimagrt logging
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 23:10:26 +01:00
Matthias Beyer 59f16d0eab Add feature: Public logging initialization
This feature is required for the `imag` binary. It allows the binary to
use the imag internal logger for logging its own log output.

We need to be able to initialize the logger from an external module (in
all imag modules, the Runtime::new() implementation takes care of this,
but as we cannot use that in the `imag` binary itself, we allow this
method to be public behind a feature flag).

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 23:10:26 +01:00
Matthias Beyer 84f2f2c46f Merge branch 'minor'
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 17:35:05 +01:00
Matthias Beyer 21927d4225 imag build script: Update available commands 2018-10-31 17:15:29 +01:00
Matthias Beyer 0bae898090 Remove unused script
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 17:15:29 +01:00
Matthias Beyer 1d97e36c93 Add more CLI validators
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 17:15:29 +01:00
Matthias Beyer 444498e13c Update nix expression 2018-10-31 17:15:29 +01:00
Matthias Beyer 43f91ebf36 Do print properly
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 17:15:29 +01:00
Matthias Beyer d8d60fa62f Move hook to have right file name
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 17:15:29 +01:00
Matthias Beyer 4bc25c3b80 Add sendemail-validate hook for checking signoffby lines
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 17:15:29 +01:00
Matthias Beyer 366ca62eb9 Update dependency: mdcat: 0.8 -> 0.11 2018-10-31 17:15:29 +01:00
Matthias Beyer d1ce5188ee Update rustc versions
Rust 1.30 came out today, so we're updating the minimum version we
depend on.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 17:14:35 +01:00
Matthias Beyer a749d97a16 Merge branch 'failure'
I'm so happy to finally be able to merge this patchset. After four days
of work, we finally convert the whole codebase from error_chain error
handling to failure.

Dependencies are now imported from "master" or even "failure" branches,
which will result in dependencies breaking the imag build as soon as the
"failure" branches vanish or the master breaks on the dependencies, but
we do it anyways until we are in release-shape.

Thanks goes to Kai for emotional support during the last weekend while
developing this patchset.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 19:26:11 +01:00
Matthias Beyer aff5059652 imag-todo: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
Matthias Beyer 5821a55c14 imag-mail: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
Matthias Beyer fd2367b849 imag-timetrack: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
Matthias Beyer d7eda6c451 imag-log: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00