Commit Graph

403 Commits

Author SHA1 Message Date
flip1995 009539dfd3 [No-auto] bin/domain/log: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995 3b941f23e3 [No-auto] bin/domain/habit: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995 1bb6f452e9 [No-auto] bin/domain/diary: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995 397bcd43d0 [No-auto] bin/domain/contact: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995 7a97c02584 [No-auto] bin/domain/bookmark: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995 8562065bea [Auto] bin/core/wiki: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995 e32d82f915 [Auto] bin/core/todo: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995 f7f95a651f [Auto] bin/core/timetrack: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995 e0e4d4e720 [Auto] bin/core/notes: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995 419a5ffa77 [Auto] bin/core/mail: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995 a02883511b [Auto] bin/core/log: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995 c9c7439f92 [Auto] bin/core/habit: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995 171757f5ca [Auto] bin/core/diary: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995 5b4b699875 [Auto] bin/core/contact: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995 3963e5ec2d [Auto] bin/core/bookmark: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
Matthias Beyer b3eb37dde8 Fix: imag-log should report touched entries 2019-08-25 12:55:45 +02:00
Matthias Beyer 605b98276d Run "cargo fix --all-features" in root of project
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-25 12:17:07 +02:00
flip1995 aa23fb485c Fix match same arms bug found by clippy
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-07-26 23:05:09 +02:00
Matthias Beyer 6ac6db57d1 Add imag-timetrack shell
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>
2019-07-25 20:32:33 +02:00
Matthias Beyer d5fd773da8 Change imag-wiki interface to be consistent with other commands
Use "list" instead of "ids" for listing ids in a wiki.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-07-25 19:59:01 +02:00
Matthias Beyer 1196f5395d Add debug output
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-07-25 19:53:41 +02:00
Matthias Beyer 03fec5f4db List diaries only if output is not a pipe
Beforehand, this command:

    imag diary -d foo list | cat

listed each entry twice because the reporting feature of libimagrt
forwarded the list to stdout and the normal output was written to
stderr.

With this patch, we get the output only once in this case.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-07-21 10:42:27 +02:00
Matthias Beyer ce9fb3c370 Fix for update to latest itertools
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-07-14 12:07:41 +02:00
Matthias Beyer be0436064c Remove uneccessary call to iter()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-30 19:47:28 +02:00
Matthias Beyer 2185d44011 Update all dependencies
This patch updates all dependencies but not "nom".

Done with `cargo upgrade --all` and manual editing.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-30 16:44:23 +02:00
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
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 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 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 c767e6239e Remove unused parameter
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-09 21:48:26 +01:00
Matthias Beyer 8d0ae1058e Make code more functional by more function chaining
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-07 13:51:42 +01:00
Matthias Beyer 07cbecc1ba Make code more functional by more function chaining.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-07 13:51:28 +01:00
Matthias Beyer d8a6e9ca9a Rewrite iteration without collecting inbetween
Because why not?

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-07 12:48:35 +01:00
Matthias Beyer 8e1768b424 Refactor code to be more idomatic
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-07 11:52:31 +01:00
Matthias Beyer f6483f54db Add ID reporting in imag-timetrack 2018-11-06 20:35:18 +01:00
Matthias Beyer be56f9fe75 Add ID reporting in imag-mail 2018-11-06 20:35:18 +01:00
Matthias Beyer 502cdf5721 Add ID reporting in imag-habit 2018-11-06 20:35:18 +01:00
Matthias Beyer f3a03efd5d Add ID reporting in imag-wiki
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-06 20:35:18 +01:00
Matthias Beyer 860c58cbdf Add ID reporting in imag-log 2018-11-06 20:35:18 +01:00
Matthias Beyer eceae358f8 Add ID reporting in imag-notes 2018-11-06 20:35:18 +01:00
Matthias Beyer 2ca6be8322 Add id reporting in imag-diary 2018-11-06 20:35:18 +01:00
Matthias Beyer 8523ae2120 Add id reporting in imag-contact 2018-11-06 20:34:46 +01:00
Matthias Beyer 344aae5f92 Add ID reporting in imag-bookmark 2018-11-06 20:33:30 +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 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 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