Commit Graph

343 Commits

Author SHA1 Message Date
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 df62e6f1b3 Add support to only list links
This patch adds support in imag-markdown to only list links that are
found in the markdown.

The list format includes the link title, which I consider convenient in
this case, but still easily scriptable.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-17 21:59:15 +02:00
Matthias Beyer 632062caed Add imag-markdown
This patch adds a tool to process one or more entries as markdown and
print them as html.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-17 21:54:43 +02:00
Matthias Beyer a7f2826bb9 Fix: Do only check entries which are a ref
We should not try to check entries that are not refs because this will
always fail. And because we fail _hard_, the execution of the command
fails on the first non-ref-entry and exits the program. Not good for a
filter... :-)

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-27 01:57:40 +02:00
Matthias Beyer 485779a176 Implement list-dead subcommand
This patch implements a helper in imag-ref to list all dead references
either by store id or by path which is referenced.

Suggested-by: Leon Schürmann <leon@is.currently.online>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 15:02:34 +02:00
Matthias Beyer dc60942111 Add CLI interface for listing dead refs
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 15:02:34 +02:00
Matthias Beyer 0d5229be10 Refactor error handling
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 14:40:07 +02:00
Matthias Beyer 9424661393 Add setting to override basepath setting
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 14:40:07 +02:00
Matthias Beyer fd980299a5 Ignore ".d" binaries in debug build
The comment in the patch should be self-explanatory.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 14:24:46 +02:00
Matthias Beyer de522ec0f2 Fix for rust beta compiler
The beta compiler reports duplicated input:

error: the item `IntoValues` is imported redundantly
   --> lib/entry/libimagentrylink/src/internal.rs:398:13
    |
36  | use self::iter::IntoValues;
    |     ---------------------- the item `IntoValues` is already imported here
...
398 |         use internal::iter::IntoValues;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |

so we fix this here.

Other imports were fixed as well.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-13 22:06:53 +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 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 27c0a30494 Add config fetching function for Ref::get_path() parameter
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-20 14:43:42 +01:00
Matthias Beyer 6681f9fcfd Remove unused code
Because the store is more efficient when reading and writing entries to
disk, we do not need to flush the cache anymore.

Hence, remove the flushing.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-18 16:02:49 +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 49df7f54a9 Rewrite imag-ref 2019-02-17 11:09:48 +01:00
Matthias Beyer a6ad19a14f Merge branch 'redefine-storeid'
Finally merging the redefine of the StoreId implementation, which allows
easier handling of StoreId objects.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 22:15:58 +01:00
Matthias Beyer 08b7a46c74 Use StoreId::local_display_string() for less errorhandling here
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 22:15:06 +01:00
Matthias Beyer aa5ea533c7 Add imag-header
imag-header is a tool for querying information of an entry in a defined
format.

imag-header is intended for scripting with imag commands.
The output format is not stable yet, though.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 20:54:52 +01:00
Matthias Beyer 0888e4345c Use StoreId::local_display_string() for less errorhandling here
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 20:53:29 +01:00
Matthias Beyer f558556b3a Fix for new all_annotations() interface
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 20:53:29 +01:00
Matthias Beyer 1bbd2173b7 Fix for new StoreId::new() interface
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 20:53:29 +01:00
Matthias Beyer 5fe139e02b Adapt StoreId::new() calls
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 20:53:29 +01:00
Matthias Beyer 39d638daee Adapt for new StoreId API
When printing the storepath with the ID (when requested by the user), we
have to ask the store for its path.

This is a rather naive implementation which could be improved by only
checking for a boolean in the last iteration and then use a prepared
variable, rather than making the storepath part of the iterator.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 20:53:29 +01:00
Matthias Beyer 642702b724 Rewrite: StoreId::new_baseless() -> StoreId::new()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 20:53:28 +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 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 03e0864268 Merge branch 'unnamed-annotations' into master-ff
This merge adds several patches to improve libimagannotation and
imag-annotate.
2019-02-10 17:07:35 +01:00
Matthias Beyer 53022443ab Rewrite iteration
This patch rewrites how imag-annotate iterates over the ids to process
to be more easily to understand.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10 01:00:38 +01:00
Matthias Beyer d8cd10a384 Remove iterator types
With this patch, libimagentryannotation does not have special iterator
types anymore. This makes the whole thing more comfortable to use.

In imag-annotate, the parameter for the functioncall was removed.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10 01:00:33 +01:00
Matthias Beyer c84258da3d Add flag to not print name of annotation
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10 00:58:21 +01:00
Matthias Beyer ab5078f111 Rewrite "add annotation" command
Because before we created a new annotation for each ID to be annotated,
which is not the expected behaviour.

Now we create one annotation object and then link it to all IDs which
are provided on the commandline.

Also, the annotation name is printed.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10 00:58:21 +01:00
Matthias Beyer e4ef6f0649 Remove log-destination-override features
This removes the feature to be able to override log destinations from
the commandline.

This feature is removed because the --override-config feature from the
runtime already contains this functionality. It is a little more complex
to use, though this is a feature hardly used at all, so I rather go for
less code (less complexity) here than feature bloat.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-05 01:03:39 +01:00
Matthias Beyer 4c0baa58f4 Add argument forwarding for --ignore-ids
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-05 00:59:30 +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 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
Matthias Beyer f20298cbe8 Add ID reporting in imag-store 2018-11-06 20:35:18 +01:00
Matthias Beyer c616a5cfaf Add ID reporting in imag-ref 2018-11-06 20:35:18 +01:00
Matthias Beyer 96ad41ea4c Add ID reporting in imag-mv 2018-11-06 20:35:18 +01:00
Matthias Beyer 1e6d58bf4c Add ID reporting in imag-view 2018-11-06 20:33:30 +01:00
Matthias Beyer d3400167df Add ID reporting in imag-tag 2018-11-06 20:33:30 +01:00
Matthias Beyer aef969f8bb Add ID reporting in imag-link 2018-11-06 20:33:30 +01:00
Matthias Beyer 4e5315b0e5 Add ID reporting in imag-grep 2018-11-06 20:33:30 +01:00
Matthias Beyer ff809a3750 Add ID reporting in imag-gps 2018-11-06 20:33:30 +01:00
Matthias Beyer 3a6443b3ef Add ID reporting in imag-ids
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-06 20:33:30 +01:00
Matthias Beyer 274811243f Move imag-view to ID provider infrastructure 2018-11-06 20:33:30 +01:00
Matthias Beyer f83d72033f Move imag-tag to ID provider infrastructure 2018-11-06 20:33:30 +01:00