Commit graph

5939 commits

Author SHA1 Message Date
c0000b6410 Rewrite .map_err_trace_exit_unwrap()
Necessary because error types changed
2018-02-12 21:19:48 +01:00
50b0ffa6ae Remove calls to trace_error_exit() 2018-02-12 21:19:48 +01:00
3845399fb8 Simplify implementation for new libimagerror interface 2018-02-12 21:19:48 +01:00
ba1c6c06fa Add error chaining for compatibility with new libimagerror interface 2018-02-12 21:19:48 +01:00
1f4c0cafe4 Remove calls to trace_error_exit 2018-02-12 21:19:48 +01:00
a43232230b Fix error handling for new API 2018-02-12 21:19:48 +01:00
7892782675 Refactor error handling 2018-02-12 21:19:48 +01:00
074f9826fd Implement own displaying implementation for the chain 2018-02-12 21:19:48 +01:00
b9800e19e9 Refactor imag-diary to use new error handling interface 2018-02-12 21:19:48 +01:00
503b042690 Adapt libimagrt to new error handling 2018-02-12 21:19:47 +01:00
6dd24f3da3 Keep trace_error{,_dbg} for backwards compatibility 2018-02-12 21:19:47 +01:00
e481dbfd12 Rewrite libimagerror to be thin layer over error-chain 2018-02-12 21:19:47 +01:00
365d0a1cb8
Merge pull request #1282 from matthiasbeyer/libimagtimetrack/refactor
libimagtimetrack: refactor
2018-02-12 11:41:20 +01:00
4a4e528aed Refactor error handling
Refactor error handling so we do chain the error with the `?`
operator rather than wrapping it with own types.

Links to other error chains are created with error chain. All unneeded
error kinds were removed.

No API changes.
2018-02-11 23:44:27 +01:00
77be32d80f Remove "get" iterator, store provides this now 2018-02-11 23:44:27 +01:00
f33768abbf
Merge pull request #1283 from matthiasbeyer/imag-timetrack/kairos-support-in-listing-bounds
imag-timetrack: Add kairos support in "list" subcommand
2018-02-11 23:43:59 +01:00
cf0f93104d Add kairos support in "list" subcommand
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.
2018-02-11 21:27:15 +01:00
4c95625def
Merge pull request #1278 from matthiasbeyer/imag-init/fix-release-build-include-string-path
imag-init: fix release build include string path
2018-02-11 17:55:27 +01:00
9e3c966d84
Merge pull request #1273 from matthiasbeyer/update-version-numbers
Update version string: 0.6.0 -> 0.7.0
2018-02-11 17:50:52 +01:00
938601f4fd
Merge pull request #1267 from matthiasbeyer/imag-link/do-not-link-entry-with-itself
Do not allow linking with entry itself
2018-02-11 16:07:36 +01:00
2e4c29dd07
Merge pull request #1277 from matthiasbeyer/libimagstore/store-debug-output-prettify
Prettify Store debug output implementation
2018-02-11 15:19:13 +01:00
8a3f2602e0 Fix include_str!() in imag-init
Fixed by symlinking the imagrc.toml file to the crate directory of
imag-init.
2018-02-11 14:43:35 +01:00
30d2c28a22 Update version string: 0.6.0 -> 0.7.0 2018-02-11 14:22:24 +01:00
5e43773158 Do not allow linking with entry itself
Without this check, linking an entry with itself yields the following
error:

    ERROR[   1]: Entry is already borrowed: StoreId { base: Some("/home/m/.imag/store"), id: "notes/test" }
    ERROR[   2]: Error when calling retrieve() -- caused:
    ERROR[   3]: Error when calling get()

Which is semantically correct, but the user may get confused by that.

Instead, we print a nice error message that the entry cannot be linked
to itself.

This is not fixed in libimagentrylink itself, because libimagentrylink
cannot be called for the same entry.
If this would be possible, we would pass two `Entry` objects
mutably to the link functionality routines. This is not possible with
Rusts borrow semantics and therefor yields above error.

We compare strings to check whether the user accidentially linked an
entry with itself because we cannot get StoreIds from Entries because we
cannot get the Entry two times from the store in the first place. So
this is the best we have.
2018-02-11 13:41:16 +01:00
8fcd2a6c8c Prettify Store debug output implementation 2018-02-11 13:36:37 +01:00
fa8af0c053
Merge pull request #1275 from matthiasbeyer/clap-features
Clap features
2018-02-11 13:29:17 +01:00
4ead39233b
Merge pull request #1280 from matthiasbeyer/imag-init/fix-git-init
Fix: git dir is not worktree dir
2018-02-11 13:29:02 +01:00
d5e0c23499
Merge pull request #1270 from matthiasbeyer/license-header-checker
License header checker
2018-02-10 23:27:57 +01:00
17b59599c4
Merge pull request #1256 from matthiasbeyer/libimagerror/trace-iterators
Add TraceIterator::trace_unwrap_exit()
2018-02-10 23:26:27 +01:00
7f4cdced4a
Merge pull request #1262 from matthiasbeyer/do-not-print-ok
Do not print "Ok" after successful execution
2018-02-10 21:22:12 +01:00
1f462e4635
Merge pull request #1264 from matthiasbeyer/imag-log/show-alias-list
Alias subcommand "show" to "list"
2018-02-10 21:22:05 +01:00
7bbc379b73
Merge pull request #1266 from matthiasbeyer/imag/list-commands-alphabetically
Sort commands alphabetically
2018-02-10 21:21:57 +01:00
faafe6e994
Merge pull request #1265 from matthiasbeyer/imag/help
Add subcommand "help"
2018-02-10 18:56:29 +01:00
3342a08587
Merge pull request #1263 from matthiasbeyer/imag-grep/dont-print-stats-if-listing-files
Do not print stats when listing files with matches
2018-02-10 18:56:17 +01:00
3b098069c5 Fix: git dir is not worktree dir 2018-02-10 18:18:39 +01:00
9f48071e48 Do not print "Ok" after successful execution 2018-02-10 16:41:27 +01:00
ec2f3a73d7 Do not print stats when listing files with matches 2018-02-10 16:41:23 +01:00
2dfede240e Alias subcommand "show" to "list" 2018-02-10 16:41:20 +01:00
c17b256dfd Add subcommand "help" 2018-02-10 16:41:15 +01:00
863b52c2f0 Add TraceIterator::trace_unwrap_exit()
* Exits on the first Err(_)
* Introduces new Iterator type for iterating with unwrap and exit on
  error
2018-02-10 16:41:06 +01:00
45cec64575 Sort commands alphabetically 2018-02-10 16:40:53 +01:00
8b101bfaa8 Integrate license-check script in CI jobs 2018-02-10 16:40:47 +01:00
8fe71c5b73 Add check script whether license headers are there and updated 2018-02-10 16:40:47 +01:00
8656a38c50 Update dependency: clap: 2.17 -> 2.29 2018-02-10 16:40:34 +01:00
9d2900a7dc Compile clap with suggestions and color support 2018-02-10 16:40:34 +01:00
edd5925f88
Merge pull request #1272 from matthiasbeyer/prepare-0.6.0
Prepare 0.6.0 release
2018-02-10 16:38:11 +01:00
ee85ebd8a1 Rename switch for new pandoc version 2018-02-10 15:40:13 +01:00
35bc1009f2 Revert "Fix include path for release"
This reverts commit c229d7d1fc.
2018-02-10 15:14:03 +01:00
c461af6a07 Reorder crates because of changed dependencies 2018-02-10 15:12:51 +01:00
c229d7d1fc Fix include path for release 2018-02-10 15:08:40 +01:00