Commit graph

5649 commits

Author SHA1 Message Date
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
e043304767 Add FileLockEntry-getter in Mail struct 2018-11-06 14:48:49 +01:00
e919435504 Fix: Remove call to deprecated function 2018-11-06 14:48:49 +01:00
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
b4068bad0e Remove println call
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 21:33:18 +01:00
1347784898 Merge branch 'safe-output'
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 21:22:26 +01:00
4756811e35 Merge branch 'minor'
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 21:22:00 +01:00
a45691ef27 Change test output to use debug!() 2018-11-01 20:37:02 +01:00
1f5b490dd7 Change test output to use debug!() 2018-11-01 20:37:02 +01:00
83876b7c2c Change test output to use debug!() 2018-11-01 20:37:02 +01:00
f01a262bdf Add debugging output in test via logger 2018-11-01 20:37:00 +01:00
3bf3a8890b Add debugging output in test via logger 2018-11-01 20:36:46 +01:00
089d5b98cb Use error output from runtime to print error 2018-11-01 20:36:34 +01:00
afeb4031ac Use runtime provided error stream
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 20:34:58 +01:00
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
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
993f83a31b Print Runtime errors to stderr 2018-11-01 20:26:25 +01:00
ea7c239e1f Merge branch 'fixes'
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 13:59:57 +01:00
7f0d5b8bfd Do not pass --rtp in test runtime 2018-11-01 13:19:14 +01:00
71086b67d8 Add debug output in test runtime generating macro 2018-11-01 13:18:58 +01:00
32f38945f0 Fix tests: Do not pass "internal", subcommand does not exist anymore 2018-11-01 13:15:19 +01:00
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
1a1cc885cc Merge branch 'rt-remove-default-value-verbosity'
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 00:05:42 +01:00
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
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
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
c4c52e43a6 Add some debugging output 2018-10-31 23:11:06 +01:00
9636cef7a8 Print (debugging) CLI when initializing runtime
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 23:11:06 +01:00
e4ffeddf85 Use libimagrt logging
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 23:10:26 +01:00
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
84f2f2c46f Merge branch 'minor'
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 17:35:05 +01:00
21927d4225 imag build script: Update available commands 2018-10-31 17:15:29 +01:00
0bae898090 Remove unused script
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 17:15:29 +01:00
1d97e36c93 Add more CLI validators
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 17:15:29 +01:00
444498e13c Update nix expression 2018-10-31 17:15:29 +01:00
43f91ebf36 Do print properly
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 17:15:29 +01:00
d8d60fa62f Move hook to have right file name
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 17:15:29 +01:00
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
366ca62eb9 Update dependency: mdcat: 0.8 -> 0.11 2018-10-31 17:15:29 +01:00
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
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
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
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
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
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
62eb711409 imag-wiki: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
1362a3f9ea imag-bookmark: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
3ac30c0944 imag-contact: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
4486abed84 imag-diary: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
8fb35b5fe1 imag-habit: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00