Commit Graph

403 Commits

Author SHA1 Message Date
Matthias Beyer c0000b6410 Rewrite .map_err_trace_exit_unwrap()
Necessary because error types changed
2018-02-12 21:19:48 +01:00
Matthias Beyer 50b0ffa6ae Remove calls to trace_error_exit() 2018-02-12 21:19:48 +01:00
Matthias Beyer 3845399fb8 Simplify implementation for new libimagerror interface 2018-02-12 21:19:48 +01:00
Matthias Beyer ba1c6c06fa Add error chaining for compatibility with new libimagerror interface 2018-02-12 21:19:48 +01:00
Matthias Beyer 1f4c0cafe4 Remove calls to trace_error_exit 2018-02-12 21:19:48 +01:00
Matthias Beyer a43232230b Fix error handling for new API 2018-02-12 21:19:48 +01:00
Matthias Beyer 7892782675 Refactor error handling 2018-02-12 21:19:48 +01:00
Matthias Beyer b9800e19e9 Refactor imag-diary to use new error handling interface 2018-02-12 21:19:48 +01:00
Matthias Beyer 77be32d80f Remove "get" iterator, store provides this now 2018-02-11 23:44:27 +01:00
Matthias Beyer 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
Matthias Beyer 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
Matthias Beyer 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
Matthias Beyer 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
Matthias Beyer 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
Matthias Beyer 30d2c28a22 Update version string: 0.6.0 -> 0.7.0 2018-02-11 14:22:24 +01:00
Matthias Beyer 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
Matthias Beyer fa8af0c053
Merge pull request #1275 from matthiasbeyer/clap-features
Clap features
2018-02-11 13:29:17 +01:00
Matthias Beyer 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
Matthias Beyer 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
Matthias Beyer 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
Matthias Beyer 7bbc379b73
Merge pull request #1266 from matthiasbeyer/imag/list-commands-alphabetically
Sort commands alphabetically
2018-02-10 21:21:57 +01:00
Matthias Beyer faafe6e994
Merge pull request #1265 from matthiasbeyer/imag/help
Add subcommand "help"
2018-02-10 18:56:29 +01:00
Matthias Beyer 3b098069c5 Fix: git dir is not worktree dir 2018-02-10 18:18:39 +01:00
Matthias Beyer 9f48071e48 Do not print "Ok" after successful execution 2018-02-10 16:41:27 +01:00
Matthias Beyer ec2f3a73d7 Do not print stats when listing files with matches 2018-02-10 16:41:23 +01:00
Matthias Beyer 2dfede240e Alias subcommand "show" to "list" 2018-02-10 16:41:20 +01:00
Matthias Beyer c17b256dfd Add subcommand "help" 2018-02-10 16:41:15 +01:00
Matthias Beyer 45cec64575 Sort commands alphabetically 2018-02-10 16:40:53 +01:00
Matthias Beyer 8656a38c50 Update dependency: clap: 2.17 -> 2.29 2018-02-10 16:40:34 +01:00
Matthias Beyer 9d2900a7dc Compile clap with suggestions and color support 2018-02-10 16:40:34 +01:00
Matthias Beyer 35bc1009f2 Revert "Fix include path for release"
This reverts commit c229d7d1fc.
2018-02-10 15:14:03 +01:00
Matthias Beyer c229d7d1fc Fix include path for release 2018-02-10 15:08:40 +01:00
Matthias Beyer 3b710e082d Add missing Cargo.toml metadata 2018-02-10 14:11:46 +01:00
Matthias Beyer d5a9e4930d Update dates in license header
And add missing header in one file
2018-02-07 02:48:53 +01:00
Matthias Beyer 1217d88a50 Fix links after moving entry 2018-02-06 23:37:21 +01:00
Matthias Beyer 864e457dce
Merge pull request #1259 from matthiasbeyer/imag-log/no-leading-space
Do not put a leading space in the log
2018-02-06 23:29:22 +01:00
Matthias Beyer da74896248
Merge pull request #1258 from matthiasbeyer/imag-log/dont-list-non-log-entries
Do not list entries which are not "log" entries
2018-02-06 22:39:13 +01:00
Matthias Beyer 1b588172dd
Merge pull request #1255 from matthiasbeyer/imag-notes/fix-list
Fix imag-notes list errors
2018-02-06 21:45:37 +01:00
Matthias Beyer 88b7b43d2c Do not put a leading space in the log 2018-02-06 20:54:11 +01:00
Matthias Beyer f44f13e23a Do not list entries which are not "log" entries 2018-02-06 20:48:47 +01:00
Matthias Beyer 97e613d8c5 Use libimagstore get iterator
Use libimagstore infrastructure to transform iterator in
StoreIdGetIterator for getting entries from store.
2018-02-06 20:41:13 +01:00
Matthias Beyer 8cba4daf20 Print to stderr 2018-02-06 19:28:27 +01:00
Matthias Beyer 85d1c632d3 Print "imag-<tool>" rather than only "<tool>"
The error output should note "imag-<tool> exited with ..." rather than
only "<tool> exited with ..."
2018-02-06 19:28:08 +01:00
Matthias Beyer 3b138ba881
Merge pull request #1231 from matthiasbeyer/update-kairos
Update kairos dependency: 0.1.0-beta-2 -> 0.1.0
2018-02-05 17:30:55 +01:00
Matthias Beyer e2e3b4f6e2 Update kairos dependency: 0.1.0-beta-2 -> 0.1.0 2018-02-05 16:20:05 +01:00
Matthias Beyer d1fc8c3995 Add second support in imag-diary commandline interface 2018-02-04 19:51:07 +01:00
Matthias Beyer ae4ced9587 Show content by default 2018-02-01 21:47:09 +01:00
Matthias Beyer 8e931cd79f Change calls to into_get_iter() to not take argument 2018-02-01 16:46:38 +01:00
Matthias Beyer 030e32e44f Provide StoreId Iterator which has a ref to the Store
This change is needed so we can refactor the "get" iterator to not take
an argument (the store) later, which improves the API.
2018-02-01 15:47:39 +01:00
Matthias Beyer da4b823048
Merge pull request #1219 from matthiasbeyer/minor
Minor patches
2018-02-01 13:18:31 +01:00
Matthias Beyer 4d94791b1f Move date <-> string conversion utility to libimagutil 2018-02-01 09:26:33 +01:00
Matthias Beyer 30ef3bf0d3 Comment type fixed 2018-01-29 09:38:32 +01:00
Matthias Beyer 7731b88c97 Remove map_err_trace_exit() calls in favour of map_err_trace_exit_unwrap() 2018-01-29 09:38:32 +01:00
Matthias Beyer 82b67115e6 Refactor: Minify
Pull in new dependencies for minification
2018-01-29 09:38:32 +01:00
Matthias Beyer 74f58d6c06 Remove unused imports 2018-01-29 09:38:32 +01:00
Matthias Beyer 53bf1a513b Implement stopping all tags which are started 2018-01-28 20:51:20 +01:00
Matthias Beyer 3735fbac2f
Merge pull request #1166 from matthiasbeyer/log-0-4-0
Dependency update: log 0.4.0
2018-01-18 15:40:50 +01:00
Matthias Beyer fcfc397fc8 env_logger: 0.5.0-rc.2 -> 0.5 2018-01-18 14:15:40 +01:00
Matthias Beyer 45ac9b4132 Change list command to use a table for output 2018-01-16 14:48:48 +01:00
Matthias Beyer 8d9c7dce4f env_logger: 0.5.0-rc.1 -> 0.5.0-rc.2 2018-01-15 11:22:09 +01:00
Matthias Beyer 635d000344 log: 0.4.0-rc.1 -> 0.4.0 2018-01-15 11:21:52 +01:00
Matthias Beyer c45130ddd0 env_logger: 0.4.* -> 0.5.0-rc.1 2018-01-15 11:20:27 +01:00
Matthias Beyer f209e12410 Update dependency: log: 0.3.* -> 0.4.0-rc.1 2018-01-15 11:20:07 +01:00
Matthias Beyer 5beadbbf5b Call default command if no command is passed 2018-01-13 14:36:31 +01:00
Matthias Beyer 284f12e8cb Refactor: Split actual list implementation from argument processing 2018-01-13 14:36:31 +01:00
Matthias Beyer 47e98675e7 imag-todo: Replace read with typed read 2018-01-13 01:14:03 +01:00
Matthias Beyer 55d97e565d imag-log: Replace read with typed read 2018-01-13 01:14:03 +01:00
Matthias Beyer f0e8e89c15 imag-contact: Replace read with typed read 2018-01-13 01:14:03 +01:00
Matthias Beyer 137680498c imag-bookmark: Replace read with typed read 2018-01-13 01:14:03 +01:00
Matthias Beyer 0a78d43741 imag-view: Replace read with typed read 2018-01-13 01:14:03 +01:00
Matthias Beyer 0c4be78223 Update dependency: toml-query -> 0.6 2018-01-13 01:14:03 +01:00
Matthias Beyer bfc35e0517 Remove dependency "version"
Because the "version" crate is licensed as GPL, which would us require
to release imag as GPL, we remove the crate now.
2018-01-12 13:33:40 +01:00
Matthias Beyer 8d69e45c0e Add imag-edit command 2018-01-09 11:56:22 +01:00
Matthias Beyer 15cc7d6805
Merge pull request #1210 from matthiasbeyer/imag-after-help
imag: Use App::after_help()
2018-01-08 23:30:51 +01:00
Matthias Beyer 0c2308bd76 Use App::after_help() for printing runtime-generated help output 2018-01-08 16:55:07 +01:00
Matthias Beyer 95e861b5ca Adapt for new API 2018-01-08 15:16:14 +01:00
Matthias Beyer 5aeaacc317
Merge pull request #1190 from matthiasbeyer/imag-init/init
imag-init: initial import
2018-01-04 19:37:50 +01:00
Matthias Beyer 38f8de15bf Revert "Integrate spinner for nicer progress reports"
This reverts commit de7a4d2dfb.
2018-01-04 12:10:07 +01:00
Matthias Beyer a6fd525c0f Add "show" functionality 2018-01-03 21:09:03 +01:00
Matthias Beyer 3cf1fd0baf Add CLI implementation 2018-01-03 16:54:08 +01:00
Matthias Beyer 7a364639ee Initial import: imag-log 2018-01-03 16:54:08 +01:00
Matthias Beyer de7a4d2dfb Integrate spinner for nicer progress reports 2018-01-03 16:00:46 +01:00
Matthias Beyer f324deb41e imag-init: initial import 2018-01-03 15:48:58 +01:00
Matthias Beyer 774933ae4a
Merge pull request #1163 from matthiasbeyer/libimagstore/mighty-iters
libimagstore: More powerful iterator extensions
2017-12-25 22:02:56 +01:00
Matthias Beyer 3c8dd19d11 Update version strings: 0.5.0 -> 0.6.0 2017-12-25 19:17:07 +01:00
Matthias Beyer d6e1994eeb Fix: Explicitely import only relevant trait 2017-12-24 13:52:50 +01:00
Matthias Beyer 8104b1cf0b Adapt tests
This changes the internal function `link_from_to` a bit, but as this is
only internal we don't care.
2017-12-23 12:57:15 +01:00
Matthias Beyer 9ec5ed9b05 Rewrite imag-link commandline to be intelligent
This patch is a rewrite for the imag-link commandline to automatically
recognize whether an internal or an external link is about to be made
and automatically do the right thing.

The commandline got a lot easier and also smaller in size (as in number
of commands), but the functionality should remain the same.
2017-12-23 12:57:13 +01:00
Matthias Beyer 05a630f943 Change UI. Positional args are not possible here 2017-12-22 14:40:01 +01:00
Matthias Beyer 6a7e7f0f12 Add functionality so we can create a habit with a due date 2017-12-22 14:40:01 +01:00
Matthias Beyer df16d0737e Adapt for new API of Habit::next_instance_date()
With cd8f0beae8
the interface of `HabitTemplate::next_instance_date()` changed to return
a `Result<Option<_>>` rather than a `Result<_>` because the
next_instance_date could be a None if the Habit was closed already.

This patch adapts imag-habit for this new interface.
2017-12-22 14:40:01 +01:00
Matthias Beyer 501f67dcf2 Add more output in today() 2017-12-22 14:40:01 +01:00
Matthias Beyer 496850a762 Add future-check in CLI and fix for default command invokation 2017-12-22 14:40:01 +01:00
Matthias Beyer 39a983f6fb Add more details to default command 2017-12-22 14:40:01 +01:00
Matthias Beyer 7cf46f99d4 Add `done` functionality 2017-12-22 14:40:01 +01:00
Matthias Beyer b78095d8bc Impl delete() 2017-12-22 14:40:01 +01:00
Matthias Beyer ff39a450b1 Explicitely state that printing an empty table is forbidden 2017-12-22 14:40:01 +01:00
Matthias Beyer 404d839310 Make "today" the default command 2017-12-22 14:40:01 +01:00
Matthias Beyer 0fa1ae28f8 Let "today" command list upcoming habits 2017-12-22 14:40:01 +01:00
Matthias Beyer 5574764d83 Add a subcommand to list habits due today 2017-12-22 14:40:01 +01:00
Matthias Beyer 2520635cae Add support for listing the next date when the habit must be done 2017-12-22 14:40:01 +01:00
Matthias Beyer 6e7414a2fd Implement show() 2017-12-22 14:40:01 +01:00
Matthias Beyer 915b1325d2 Implement list() 2017-12-22 14:40:01 +01:00
Matthias Beyer 528b30c1ff Implement create() 2017-12-22 14:40:01 +01:00
Matthias Beyer d1848e9186 Add CLI spec 2017-12-22 14:40:01 +01:00
Matthias Beyer be79f6373e Import crate for imag-habit 2017-12-22 14:40:01 +01:00
Matthias Beyer 04d5af8d50 Switch to upstream rust-vobject 2017-11-09 11:21:17 +01:00
Matthias Beyer 521d661f1c Fix path 2017-11-09 11:21:17 +01:00
Matthias Beyer 00c73d53c7 Phone and email information is in the person table 2017-11-09 11:21:17 +01:00
Matthias Beyer c8a8bdcd22 Fix format and location of content 2017-11-09 11:21:17 +01:00
Matthias Beyer c90d0ab34a Fix UUID-Filename creating, add debug output 2017-11-09 11:21:17 +01:00
Matthias Beyer 296136fca5 Add tests 2017-11-09 11:21:17 +01:00
Matthias Beyer 524df37ca6 Add parsing of personal information: Birthday 2017-11-09 11:21:17 +01:00
Matthias Beyer 794efb0034 Outsource functional part for testability 2017-11-09 11:21:17 +01:00
Matthias Beyer e211aba341 Implement create subcommand
The complexity of the create() routine justifies the move to another file.

This commit implements the create() functionality which creates a TOML
tempfile which the user should edit and then reads the contents to build
the Vcard object which then gets written to either stdout or the
destination file.

Besides that:

* Move helper function to util module
* Rewrite and fix tests
2017-11-09 11:20:32 +01:00
Matthias Beyer ab8c8e4e41 Add new required dependencies 2017-11-09 11:19:17 +01:00
Matthias Beyer d0ec7e26dc Add implementation for imag-contact
* Implement contact listing with formatting via commandline or config
* Implement importer functionality for contact
* Implement "show" subcommand
* imagrc.toml: Add explanation which fns are supported in templates
2017-11-09 11:19:17 +01:00
Matthias Beyer 0540ae9392 Initial import of imag-contact 2017-11-09 11:15:04 +01:00
Matthias Beyer dc26f8c20c
Merge pull request #1156 from matthiasbeyer/store-verify-from-cli-app
Move verify implementation from Store to CLI interface
2017-10-31 15:47:57 +01:00
Matthias Beyer 9308c05057 Replace uses of try!() macro with "?" operator 2017-10-31 15:04:50 +01:00
Matthias Beyer 1dda98e17e Replace uses of try!() macro with "?" operator 2017-10-31 15:04:50 +01:00
Matthias Beyer 246bf04dbf Replace uses of try!() macro with "?" operator 2017-10-31 15:04:50 +01:00
Matthias Beyer ee7b04dd42 Replace uses of try!() macro with "?" operator 2017-10-31 15:04:50 +01:00
Matthias Beyer a20871eb5e Add badges in Cargo.toml of all crates 2017-10-31 15:03:30 +01:00
Matthias Beyer 2855a89e24 Move verify implementation from Store to CLI interface 2017-10-31 13:11:34 +01:00
Matthias Beyer b237adfe19 Fix calls to Runtime::config() to use direct result 2017-10-31 09:25:14 +01:00
Matthias Beyer 36adac4a16 Add output about max internal links and max overall byte size 2017-10-16 14:43:21 +02:00
Matthias Beyer 6daeefa0d8 Show average link count in all entries 2017-10-16 14:43:21 +02:00
Matthias Beyer f9a56bee3f Add a few small diagnostics 2017-10-16 14:43:00 +02:00
Matthias Beyer ec78237198 Initial imag-diagnostics import 2017-10-16 14:43:00 +02:00
Matthias Beyer e7aa5af9be Merge pull request #1149 from matthiasbeyer/libimagrt/remove-logging-format-overrides
Remove override functionality for logging formats
2017-10-16 10:11:28 +02:00
Matthias Beyer 3487eb4c8a Remove override passing in imag binary command 2017-10-16 00:47:42 +02:00
Matthias Beyer 5917dade99 Fix missed version updates 2017-10-14 21:05:42 +02:00
Matthias Beyer 38494a31da Support deleting by partial hash 2017-10-14 14:05:56 +02:00
Matthias Beyer d37de44c94 Add RefStore::find_storeid_by_partial_hash() helper 2017-10-14 14:05:56 +02:00
Matthias Beyer 60f2a34074 Add debug output 2017-10-13 14:53:57 +02:00
Matthias Beyer da013d65dc Initial import for imag-annotate 2017-10-13 14:53:57 +02:00
Matthias Beyer 758166637b Update toml-query: 0.3.* -> 0.4
This update is needed for the error-chain update, as the toml-query
0.4.0 release also bumps this dependency.
2017-10-12 22:13:04 +02:00
Matthias Beyer 663242db7e Update dependency: error-chain: 0.10 -> 0.11 2017-10-12 22:12:27 +02:00
Matthias Beyer 3ed9c1fcc8 Merge pull request #1131 from matthiasbeyer/libimagerror/trace-and-unwrap-helper
Add helper for tracing error and exit or unwrap the value
2017-10-12 22:08:48 +02:00
Matthias Beyer 815cde76d0 Rewrite .map_err_trace_exit().unwrap() with new helper fn 2017-10-12 20:15:46 +02:00
Matthias Beyer 013e82f04f Update dependency: filters: 0.1 -> 0.2 2017-10-12 19:48:01 +02:00
Matthias Beyer 67a127f700 Update dependency: itertools: 0.6 -> 0.7 2017-10-12 19:45:50 +02:00
Kai Sickeler 1f84643486 Dump all StoreIds
Add StoreId Dump changes
2017-10-09 12:18:27 +02:00
Matthias Beyer 969211174a Rewrite imag-view
The imag-view command was redesigned with this change. It now looks up
view-templates in the config and calls them with the "in" subcommand.

This way, an entry can be viewed with editor, browser or whatever one
likes.

Compiling markdown is not supported yet.
2017-10-08 15:08:27 +02:00
Matthias Beyer d9add138d2 Use positional argument for id 2017-10-08 13:02:56 +02:00
Matthias Beyer c5ad59e96f Initial import of imag-mv 2017-10-01 10:07:29 +02:00
Matthias Beyer 169107d569 Remove FoldResult 2017-09-30 10:45:10 +02:00
Matthias Beyer 643db0df3a Remove libimagcounter / imag-counter 2017-09-28 22:41:23 +02:00
Matthias Beyer 73f6016221 Update version strings: 0.4.0 -> 0.5.0 2017-09-24 13:05:01 +02:00