This patch adds a subcommand to imag-timetrack which allows a user to
start a $SHELL and start a timetracking with it and as soon as the shell
exits, the timetracking is stopped.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This patch updates all dependencies but not "nom".
Done with `cargo upgrade --all` and manual editing.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
When installing (a subcrate) from crates.io, it fails because it cannot
find the buildscript. This is the quickfix, simply remove the
buildscript itself and the setup of the buildscript in all Cargo.toml
files.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
With this patch we move the codebase to Rust-2018.
The diff was generated by executing
cargo fix --all --all-features --edition
on the codebase.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This patch adds the -d / --show-duration feature to the "list"
subcommand, which makes imag-timetrack list the duration of the
timetracking in the output.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
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>
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>
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>
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>
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>
This patch adds kairos support in the "list" subcommand for the "-f" and
"-t" parameters which limit the entries to show.
Something like
imag timetrack list --from yesterday
is now possible.