Commit Graph

48 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 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 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 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 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 860c58cbdf Add ID reporting in imag-log 2018-11-06 20:35:18 +01:00
Matthias Beyer 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
Matthias Beyer 764a019817 Update dependency: log: 0.3 -> 0.4 2018-09-27 15:05:45 +02:00
Matthias Beyer 3d12998603 Update dependency: toml-query: 0.6 -> 0.7 2018-09-27 15:05:44 +02:00
Matthias Beyer dc49b2265c Fix: Binary name
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-08-26 04:24:57 +02:00
Matthias Beyer 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
Matthias Beyer 664edc7943 Update version string: 0.8.0 -> 0.9.0 2018-05-09 11:39:33 +02:00
Matthias Beyer ee75d2309c Fix: imag-log show should order by datetime 2018-04-22 14:33:53 +02:00
Matthias Beyer d2dceb6640 Update version numbers: 0.7.0 -> 0.8.0 2018-04-19 10:05:53 +02:00
Matthias Beyer 4568b1f625
Merge pull request #1380 from matthiasbeyer/minor
Minor patches
2018-04-18 16:46:41 +02:00
Matthias Beyer 98f8366e4c Fix documentation in crate metadata 2018-04-17 15:55:08 +02:00
Matthias Beyer 51b9b5c0db Fix: Use qualification 2018-04-14 00:58:40 +02:00
Matthias Beyer aeec10bf76 Use clap with wrap_help feature 2018-04-13 16:19:10 +02:00
Matthias Beyer b59c234588 Use clap "^2.29" instead of ">=2.29" 2018-04-13 16:17:43 +02:00
Matthias Beyer 8c1b4124c0 Handle unknown subcommands in binaries with Runtime::handle_unknown_subcommand 2018-04-04 19:34:13 +02:00
Matthias Beyer 50461b839a Use output stream from Runtime::stdout() 2018-03-04 13:57:44 +01:00
Matthias Beyer eccb52a85c Fix imag-log for new Diary::entries() interface 2018-03-02 23:27:20 +01:00
Matthias Beyer 6a341d3723 Abstract exit code as a type 2018-02-19 11:14:18 +01:00
Matthias Beyer 013fc75d85 Fix output for broken pipe errors 2018-02-19 10:40:26 +01:00
Matthias Beyer 9469693763 Use new make_imag_version!() macro for building version string 2018-02-13 11:38:34 +01:00
Matthias Beyer 30d2c28a22 Update version string: 0.6.0 -> 0.7.0 2018-02-11 14:22:24 +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 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 9f48071e48 Do not print "Ok" after successful execution 2018-02-10 16:41:27 +01:00
Matthias Beyer 2dfede240e Alias subcommand "show" to "list" 2018-02-10 16:41:20 +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 d5a9e4930d Update dates in license header
And add missing header in one file
2018-02-07 02:48:53 +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 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 55d97e565d imag-log: 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 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