Commit Graph

328 Commits

Author SHA1 Message Date
Matthias Beyer 6b8c236b67 Merge branch 'libimaghabit-dont-copy-comment-to-instance' into master 2019-06-30 13:14:36 +02:00
Matthias Beyer a9bde370a3 Merge branch 'imag-log-show-multiple-sort-by-date' into master 2019-06-30 13:14:24 +02:00
Matthias Beyer 62d6b54542 Adapt imag-habit impl for `HabitInstance::get_comment()`
The implementation of `HabitInstance::get_comment()` was changed and
therefore its semantics were changed.

This patch adapts the call to the function for the new signature and
implications.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-30 11:31:56 +02:00
Matthias Beyer 82c2beafbb Add "done" marker in "list" output
This patch adds a marker in the table when using the "list" command
which marks when the task is already done for the list entry.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-30 11:09:18 +02:00
Matthias Beyer 32c5ec1e00 Fix: Sort by date, not by id
This patch fixes a bug. We stated in the helptext of the "show" command
that when showing several logs, we sort by date. This was not true as we
sorted by Id, which also included the name of the log, hence we
effectively sorted by name.

This patch fixes that. Output is not sorted by date.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-30 10:57:21 +02:00
Matthias Beyer 99da4b777a Rename module: timetrackingstore -> store 2019-06-26 20:27:06 +02:00
Matthias Beyer 34d5a3d62c Add option to imag-log to ignore newlines
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-26 20:26:59 +02:00
Matthias Beyer 5dc6829354 Rename module: linker -> linkable
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-21 23:22:48 +02:00
Matthias Beyer ef17930c29 Rename interface
With this patch, the libimagentrylink library interface gets renamed.

The trait gets renamed to the more descriptive name "Linkable", the
functions get renamed to not contain any notion of "internal" anymore.

This patch also adapts the whole source tree for the new libimagentrylink
interface, also renaming variables to not contain "_internal_" anymore.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-21 23:22:47 +02:00
Matthias Beyer f21b6e53a2 Merge branch 'libimagentrylink-split' into master 2019-06-15 16:48:50 +02:00
Matthias Beyer 901502b67e Split "internal" module into several submodules
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-31 12:48:00 +02:00
Matthias Beyer bb4f0ace6b Fix imag-diary to ignore broken pipes
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-30 11:12:47 +02:00
Matthias Beyer cee7689e77 Replace deprecated functioncall
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-30 10:09:45 +02:00
Matthias Beyer a7d53e47d1 Update toml-query to 0.9.0
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-29 18:39:25 +02:00
Matthias Beyer 1482f70320 Update dependency: toml: 0.4 -> 0.5
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-29 18:39:25 +02:00
Leon Schuermann ed457495c8 Introduce proper error handling in IdPathProvider
Prior to this change, the IdPathProvider implementation would be
responsible for exiting the process on insufficient / wrong arguments.
However, such error handling should be performed together with the
business logic and not in CLI-parsing related code.

This change introduces a clear separation: both parsing errors and
insufficient id path arguments can now be return from inside the
`get_ids`-method, and get passed up to the application logic to be
handled.

This change is reflected in all instances of IdPathProvider and their
surrounding code.

Signed-off-by: Leon Schuermann <leon.git@is.currently.online>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-24 21:03:34 +02:00
Matthias Beyer 911133818c Fix: Negation error
We have to check whether the configuration is _not_ a String type.
Dump fail.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-23 17:13:10 +02:00
Matthias Beyer b7d91f0905 Remove buildscripts
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>
2019-05-22 22:18:57 +02:00
Matthias Beyer 5fa6b07b9e Fix: Delete links to bookmark collection entry before deleting collection
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 02:36:02 +02:00
Matthias Beyer 49c7c81ff3 Remove unimplemented argument
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 01:59:39 +02:00
Matthias Beyer c4aa8dd5d5 Make "urls" positional argument
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-18 01:58:39 +02:00
Matthias Beyer 1d89844613 Run 'cargo fix' for rust-2018
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>
2019-05-18 00:20:59 +02:00
Matthias Beyer 3884d7319c Add duration listing in imag-timetrack
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>
2019-05-17 22:28:42 +02:00
Matthias Beyer fad684daf2 Merge branch 'imag-contact-edit-retry' into master-ff 2019-05-11 13:29:37 +02:00
Matthias Beyer aa23a51a2f Remove unused constant
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-11 12:26:50 +02:00
Matthias Beyer 8b0f187f7d Add support for looping over edit
This patch adds a imag-contact feature where we loop as long as we
cannot parse the vcard. If the `--no-retry` flag is passed, we fail immediately.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-11 12:25:41 +02:00
Matthias Beyer 989624cc5e Merge branch 'minor' into master 2019-04-27 02:00:49 +02:00
Matthias Beyer 9c467d0462 Add debug output
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-27 01:33:04 +02:00
Matthias Beyer 37d8ae7430 Add contact editing.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 16:50:07 +02:00
Matthias Beyer 9945cb38b7 Refactor: Move contact-by-hash finding to utils
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 16:50:07 +02:00
Matthias Beyer 41e981fa48 Add force-override option to "imag-contact import"
This patch adds the option to force-override the ref data in the
imported entries. This is necessary when importing contact data which is
already in the store, but where the reference data has changed (for
example if the hash of the file has changed, this might come in handy at
some point).

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 14:37:43 +02:00
Matthias Beyer 9b7edfc6c1 Rewrite imag-contact to handle reference storing
This patch rewrites the imag-contact binary to be able to work with the
new libimagcontact interface, which now uses libimagentryref for storing
references to the actual vcard files.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 14:26:56 +02:00
Matthias Beyer dfc02a5679 Move helper function to libimagentref::util
This moves the helper function for getting the `Config` object from the
configuration file via the runtime.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-20 16:22:52 +01:00
Matthias Beyer a959167b15 Rewrite imag-mail
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-20 16:22:52 +01:00
Matthias Beyer 198c59f717 Revert "Remove imag-mail"
This reverts commit f9a980c344.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-20 16:22:52 +01:00
Matthias Beyer f9a980c344 Remove imag-mail
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-17 11:09:49 +01:00
Matthias Beyer 444ca2d424 Adapt to new all_contacts() return type
because we return `libimagstore::iter::Entries` here now, we do not have
to pass the store anymore.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 20:53:29 +01:00
Matthias Beyer 2611583839 Fix: Also print if runtime ignores IDs
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 19:13:29 +01:00
Matthias Beyer 86dca4887d Fix negation error
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-11 03:52:04 +01:00
Matthias Beyer 334e9e3954 Add debug output
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11 03:52:04 +01:00
Matthias Beyer fe9409a5dc Do not print table if table is empty anyways
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-11 03:52:04 +01:00
Matthias Beyer 81912ac5cd Add wrapping functionality for imag-log
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-11 03:52:04 +01:00
Matthias Beyer 0ba19daa57 Strip whitespace on the right when printing
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11 03:52:04 +01:00
Matthias Beyer 90eaeb642a Remove magic constants in trace_unwrap_exit/map_err_trace_exit_unwrap calls
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-11 03:52:04 +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 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 9185abcfa5 Update copyright years
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-01-03 18:41:36 +01:00