Commit graph

718 commits

Author SHA1 Message Date
c767e6239e Remove unused parameter
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-09 21:48:26 +01:00
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
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
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
8e1768b424 Refactor code to be more idomatic
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-07 11:52:31 +01:00
345970d36b Import new dependencies
Because of the changes in the "src/ui.rs" files in the binary
implementations, we have new dependencies we need to import into the
build-script of the "imag" command, so that it can build the
commandline.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-06 20:35:18 +01:00
f6483f54db Add ID reporting in imag-timetrack 2018-11-06 20:35:18 +01:00
be56f9fe75 Add ID reporting in imag-mail 2018-11-06 20:35:18 +01:00
f20298cbe8 Add ID reporting in imag-store 2018-11-06 20:35:18 +01:00
c616a5cfaf Add ID reporting in imag-ref 2018-11-06 20:35:18 +01:00
502cdf5721 Add ID reporting in imag-habit 2018-11-06 20:35:18 +01:00
96ad41ea4c Add ID reporting in imag-mv 2018-11-06 20:35:18 +01:00
f3a03efd5d Add ID reporting in imag-wiki
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-06 20:35:18 +01:00
860c58cbdf Add ID reporting in imag-log 2018-11-06 20:35:18 +01:00
eceae358f8 Add ID reporting in imag-notes 2018-11-06 20:35:18 +01:00
2ca6be8322 Add id reporting in imag-diary 2018-11-06 20:35:18 +01:00
8523ae2120 Add id reporting in imag-contact 2018-11-06 20:34:46 +01:00
344aae5f92 Add ID reporting in imag-bookmark 2018-11-06 20:33:30 +01:00
1e6d58bf4c Add ID reporting in imag-view 2018-11-06 20:33:30 +01:00
d3400167df Add ID reporting in imag-tag 2018-11-06 20:33:30 +01:00
aef969f8bb Add ID reporting in imag-link 2018-11-06 20:33:30 +01:00
4e5315b0e5 Add ID reporting in imag-grep 2018-11-06 20:33:30 +01:00
ff809a3750 Add ID reporting in imag-gps 2018-11-06 20:33:30 +01:00
3a6443b3ef Add ID reporting in imag-ids
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-06 20:33:30 +01:00
274811243f Move imag-view to ID provider infrastructure 2018-11-06 20:33:30 +01:00
f83d72033f Move imag-tag to ID provider infrastructure 2018-11-06 20:33:30 +01:00
527e0310ae Move imag-link to ID provider infrastructure 2018-11-06 20:33:30 +01:00
4856541f5a Move imag-gps to ID provider infrastructure 2018-11-06 20:33:30 +01:00
70014e04b1 Move imag-ids to ID provider infrastructure 2018-11-06 20:33:30 +01:00
a805db2a88 Move imag-edit to ID provider infrastructure 2018-11-06 20:33:30 +01:00
30036d5628 Move imag-category to ID provider infrastructure 2018-11-06 20:33:30 +01:00
01de94a387 Move imag-annotate to ID provider infrastructure 2018-11-06 20:33:30 +01:00
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
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
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
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
1347784898 Merge branch 'safe-output'
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 21:22:26 +01:00
3bf3a8890b Add debugging output in test via logger 2018-11-01 20:36:46 +01:00
089d5b98cb Use error output from runtime to print error 2018-11-01 20:36:34 +01:00
afeb4031ac Use runtime provided error stream
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 20:34:58 +01:00
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
32f38945f0 Fix tests: Do not pass "internal", subcommand does not exist anymore 2018-11-01 13:15:19 +01:00
e39bd7fc72 Merge branch 'fix-flag-forwarding'
Conflicts were handled manually.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-01 00:09:54 +01:00
25ee6f2ce4 Fix: Forward flags as well
This is a bugfix. The old implementation did not forward simple
commandline flags (as in `--debug`, arguments with no value) because it
only used `ArgMatches::value_of()`. But if there is no value, the method
returns `None` and the flag is not forwarded.

This patch fixes that issue.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 23:12:35 +01:00
c4c52e43a6 Add some debugging output 2018-10-31 23:11:06 +01:00
e4ffeddf85 Use libimagrt logging
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-31 23:10:26 +01:00
21927d4225 imag build script: Update available commands 2018-10-31 17:15:29 +01:00
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
5821a55c14 imag-mail: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
fd2367b849 imag-timetrack: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
d7eda6c451 imag-log: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
62eb711409 imag-wiki: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
1362a3f9ea imag-bookmark: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
3ac30c0944 imag-contact: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
4486abed84 imag-diary: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
8fb35b5fe1 imag-habit: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
c1bc5d4bf6 imag-view: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
73362c6de3 imag-link: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
11abf55a0f imag-annotate: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
6d8bac314c imag-tag: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
e3911d97d9 imag-store: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
3272dbfd74 imag-mv: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
8114c5976c imag-diagnostics: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
279751b99c imag-ids: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
3cfe5f217c imag-gps: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
12644f22d9 imag-category: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
79b996f0ad imag: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:29 +01:00
52c5300ec8 Update about-text in imag-wiki
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-17 11:37:24 +02:00
f970fc987f Update about-text in imag-tag
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-17 11:37:24 +02:00
5b4715b311 Update about-text in imag-link
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-17 11:37:24 +02:00
0d103653ea Update about-text in imag-ids
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-17 11:37:24 +02:00
325c5ddbd0 Fix: URL in imag helptext
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-17 11:37:24 +02:00
8e232523b2 Fix: We dont have a subcommand "internal" anymore
This subcommand was passed but it does not exist. Unfortunately, the
tests did not fail...

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-09 17:37:56 +02:00
e96fb53677 Fix: Use "retrieve" instead of "create" when importing
This fixes a bug where a re-import of the contacts directory failed
because some entries already exist.
With this change, one can import the contact directory after things
changed in there and the imag database is updated accordingly, but not
altered. So links and notes are persisting.

For completeness: before, the workflow was to
`cd $IMAG_RTP && git rm store/contacts -r && imag contact import /path/to/contacts`
which is of course not optimal.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-07 10:56:56 +02:00
029b83042d Fix detecting of external links
Checking whether we have a file (on the FS) here is not enough for
either case (external link/internal link).

Thus, we should check whether a store entry with that ID exists. If it
does, we link internally, else externally by trying to parse the string
as URL.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-06 12:58:54 +02:00
f768c068e3 Update dependency: regex: 0.2 -> 1 2018-10-06 12:22:15 +02:00
0d6b345741 Update dependency: prettytable: 0.6 -> 0.8 2018-10-06 12:22:15 +02:00
f65824db22 Update dependency: prettytable: 0.6 -> 0.8 2018-10-06 12:22:15 +02:00
ab3b36ebcf Update dependencies
walkdir: 1 -> 2
uuid: 0.6 -> 0.7
2018-10-06 12:22:15 +02:00
51730eed89 Update dependency: tempfile: 2 -> 3 2018-10-06 12:21:20 +02:00
502889b9a2 Update dependency: prettytable: 0.6 -> 0.8 2018-10-06 12:21:20 +02:00
f2de746293 Update dependency: regex: 0.2 -> 1 2018-10-06 12:21:20 +02:00
2077980f22 Update dependencies: log: 0.3 -> 0.4 2018-10-06 12:21:20 +02:00
3e4fcb19bb Update dependencies: log: 0.3 -> 0.4, version: 2 -> 3 2018-10-06 12:21:20 +02:00
3b0b9c8d7b Update dependency: walkdir 1 -> 2 2018-09-30 15:04:29 +02:00
89059bb7da Fix: Use VcardBuilder instead of Vcard itself
The current implementation does not panic on VcardBuilder::build(), so
we unwrap() that directly.

Should be fixed in future versions of either rust-vobject or here, so
that we error appropriately.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-09-27 15:05:45 +02:00
d9e4eaad3c Update kairos to master branch
Because of the new error-chain version which kairos can depend on, for
which kairos is not yet released.
2018-09-27 15:05:45 +02:00
e838f0d0e7 Update dependency: handlebars: 0.29.0 -> 1.0 2018-09-27 15:05:45 +02:00
f97d9e0d96 Temporarily set vobject to custom fork until we have a new release 2018-09-27 15:05:45 +02:00
946d9891e4 Update dependency: vobject: 0.{4,5} -> 0.6 2018-09-27 15:05:45 +02:00
61738ac9ee Revert "Update dependency: handlebars: 0.29.0 -> 1.0"
This reverts commit a1f0872486995b80216e8a08a2176debdef3752a.

As updating handlebars needs some more involvement, we roll back to the
version we use currently and schedule the update for later.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-09-27 15:05:45 +02:00
c65e73acc8 Update dependency: kairos: 0.1 -> 0.2 2018-09-27 15:05:45 +02:00
abf6a3c384 Update dependency: handlebars: 0.29.0 -> 1.0 2018-09-27 15:05:45 +02:00
764a019817 Update dependency: log: 0.3 -> 0.4 2018-09-27 15:05:45 +02:00
3d12998603 Update dependency: toml-query: 0.6 -> 0.7 2018-09-27 15:05:44 +02:00
0a7afee454 Update dependency: error-chain: 0.11 -> 0.12 2018-09-27 15:05:25 +02:00
c791977aab
Merge pull request #1506 from matthiasbeyer/minor
Minor
2018-09-27 09:53:31 +02:00
6bf49aa6b5 Fix: 'imag-contact show' should increase output counter 2018-09-27 08:09:39 +02:00
6f768fe4ad Add a progressbar to the command
Note: characters in config have to be escaped.
2018-09-27 07:40:10 +02:00
430186799b Remove store flush caching as it is not necessary anymore 2018-09-27 07:31:47 +02:00
dc49b2265c Fix: Binary name
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-08-26 04:24:57 +02:00
d2bf1751ac Fix: Binary name
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-08-26 04:24:57 +02:00
9507db6d8e Fix: Binary name
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-08-26 04:24:57 +02:00
ab32f21333 Fix: Binary name
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-08-26 04:24:57 +02:00
6e56f469ae More verbose erroring in test 2018-08-26 04:24:57 +02:00
acdc1e84bc
Merge pull request #1495 from matthiasbeyer/imag-diary/fix-missing-header
Imag diary/fix missing header
2018-07-27 20:10:59 +02:00
b896bc2657 Fix: Do not create entries with Store::retrieve()
This patch fixes a bug where entries where created with
`Store::retrieve()` rather than with the API from libimagdiary.
This caused headers to be missing.

Now, the CLI is parsed for the values passed and a NaiveDateTime object
is crafted from that, which is then passed to libimagdiary.
2018-07-20 01:37:36 +02:00
22d63f0946 Add functionality to create entry at a certain time 2018-07-20 01:37:36 +02:00
f6a7345b4a Simplify: Move header verification from Value extension to Entry type 2018-07-19 20:58:27 +02:00
8d86af5f15 Fix: Use unused result 2018-06-27 00:43:36 +02:00
eb682d76e8 Prettify error messages 2018-06-15 22:07:13 +02:00
3b97db5c25 Fix: Duplicated printing of entries with "show --all"
The problem was that the used `Diary::diary_names()` iterator does not
call `unique()` on its output.
That decision was made because the return type would get more
complicated with that feature.

Now that rustc 1.26 with Impl Trait is out, we can refactor the return
types of these functions (so also with `Diary::diary_names()`) to
automatically do this.
2018-05-11 15:45:50 +02:00
664edc7943 Update version string: 0.8.0 -> 0.9.0 2018-05-09 11:39:33 +02:00
61d0136c26 imag-category: Initial import 2018-05-04 11:09:20 +02:00
9c36fc8ac0
Merge pull request #1468 from matthiasbeyer/imag-ids/filters
imag-ids: filters
2018-05-03 10:22:20 +02:00
846de028cf Add trace output in filtering process 2018-05-02 20:42:56 +02:00
191f049ea8 Add language documentation in commandline help 2018-05-02 20:42:56 +02:00
f618026305 Add store cache flushing after each 100st entry 2018-05-02 20:42:56 +02:00
c27349e94f Implement header filter language 2018-05-02 20:42:56 +02:00
f4e1c0864c Implement 'where' subcommand 2018-05-02 20:42:56 +02:00
d518322401 Add notes how the filter language should look like 2018-05-02 20:42:56 +02:00
74c982984c Move collection filter to new module 2018-05-02 20:42:56 +02:00
f85dc02db6 Revert "Deny non-absolut import pathes"
This reverts commit b90abfb868.

Because `libimagcontact` is not based on `libimagentryref` anymore (as
of 2b10ab0b36), and thus does not put
pathes into the header, we can allow non-absolute pathes here.
2018-05-02 19:42:38 +02:00
eb20a9d881
Merge pull request #1477 from matthiasbeyer/libimagstore/remove-walk
Remove Store::walk()
2018-05-02 18:39:11 +02:00
0dbef993c1 Adapt "imag store verify" implementation for removed Store::walk() 2018-05-02 17:46:45 +02:00
be62843608 Fix description 2018-05-01 22:29:46 +02:00
b86ed2ffa9 Refactor imag-wiki to new store iterator interface 2018-05-01 17:44:20 +02:00
7aca84dd5e Refactor imag-mail to new store iterator interface 2018-05-01 17:44:17 +02:00
519b6f7ef2 Refactor imag-habit to new store iterator interface 2018-05-01 17:44:14 +02:00
11f9a9027e Refactor imag-diary to new store iterator interface 2018-05-01 17:44:09 +02:00
829e425c12 Refactor imag-view to new store iterator interface 2018-05-01 17:44:05 +02:00
a9d0f3d53a Refactor imag-edit to new store iterator interface 2018-05-01 17:44:01 +02:00
dd453659ed Refactor imag-mv to fit new store iterator interface 2018-05-01 17:44:01 +02:00
e6244d7e9e Refactor imag-todo to fit new store iterator interface 2018-05-01 17:44:01 +02:00
eaf8148cda Refactor imag-ids to fit new store iterator interface 2018-05-01 17:44:01 +02:00
40a04376ed Refactor imag-link to fit new store iterator interface 2018-05-01 17:44:01 +02:00
d45eef299e
Merge pull request #1476 from matthiasbeyer/imag-diagnostics/refactor
Minify code with helper macro
2018-04-30 21:49:24 +02:00
424a060cc8
Merge pull request #1475 from matthiasbeyer/imag-diagnostics/flush-cache
imag-diagnostics: flush cache
2018-04-30 21:07:56 +02:00
004faaa905 Performe cache flushing during aggregation 2018-04-30 18:40:19 +02:00
b713718693 Minify code with helper macro 2018-04-30 14:15:34 +02:00
58a6eea573 Remove the edit command
The edit command of imag-diary gets removed by this patch.

The rationale is that imag-edit is way more powerful and thus, not every
other imag module should implement an edit command. Chaining
`imag-diary list` and `imag edit -I` is encouraged.

We still need the edit functionality in imag-diary, as `imag diary
create` shall spawn an editor, still. We only remove the ability for
editing of existing entries with this patch.
2018-04-30 14:04:16 +02:00
6d21d8eb49 Update dependency: filters: 0.2 -> 0.3 2018-04-29 10:46:36 +02:00
0976cab014
Merge pull request #1464 from matthiasbeyer/libimagentrygps/32-bit-gps-values
libimagentrygps: 32 bit gps values
2018-04-29 00:35:21 +02:00
dbb39475d9 Upgrade variables to 64 bit 2018-04-28 23:27:12 +02:00
f493b4b8c3 Fix: Allow second to be missing 2018-04-28 23:18:02 +02:00
713621337f Adapt for new libimagcontact interface 2018-04-27 16:57:48 +02:00
932ba3e7d4 Set extension or warn if none there
In case of auto-generating the file name, we should add an extension.
If we do not auto-generate the file name, we should warn that the
extension for the file is missing.
2018-04-27 13:58:46 +02:00
493fa0226c
Merge pull request #1453 from matthiasbeyer/imag-contact/create-uid
Fix: Generate UID when creating a contact
2018-04-26 16:16:33 +02:00
ad9eb62376 Fix: Generate UID when creating a contact 2018-04-26 14:43:21 +02:00
07e804a7c8 Fix: Make most fields optional 2018-04-26 14:01:53 +02:00