summaryrefslogtreecommitdiffstats
path: root/bin/domain/imag-todo/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* Fix: Do not print data if output is pipe, except if that behaviour is overriddenMatthias Beyer2020-04-131-8/+16
| | | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de> Fixes: b48c45ec4ba2 ("Change implementation to use the iterator extensions")
* Replace failure with anyhow in complete codebaseMatthias Beyer2020-03-081-35/+29
| | | | | | | | | | | | | | | | | | | | This patch was scripted with sed -i 's/use failure::Error/use anyhow::Error/' $(rg "use failure::Error" -l) sed -i 's/use failure::Fallible as /use anyhow::/' $(rg "use failure::Fallible" -l) sed -i 's/failure/anyhow/' $(rg "failure *=" -l) sed -i 's/format_err!/anyhow!/' $(rg "format_err!" -l) sed -i 's/use failure::ResultExt/use anyhow::Context/' $(rg "use failure::ResultExt" -l) sed -i 's/err_msg/anyhow!/' $(rg "use failure::err_msg" -l) sed -i 's/^anyhow\ *=.*$/anyhow = "1"/' $(rg "anyhow * =" -l) sed -i 's/^anyhow_derive.*//' $(rg "anyhow_derive" -l) sed -i 's/extern crate failure/extern crate anyhow/' $(rg "extern crate failure" -l) sed -i 's/.*extern crate anyhow_derive.*//' $(rg "anyhow_derive" -l) Some manual changes were added as well, so this patch was not completely scripted, but mostly. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Add more trace output for Viewer implementationMatthias Beyer2020-03-011-4/+11
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Change implementation to use the iterator extensionsMatthias Beyer2020-03-011-18/+16
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Fix: Also print if output is a data pipeMatthias Beyer2020-03-011-1/+1
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Add more trace outputMatthias Beyer2020-03-011-0/+4
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Fix: Simplify selecting what to printMatthias Beyer2020-03-011-17/+21
| | | | | | | | | | | | | | | | | | The logic before that change was a bit bogus, as it printed stuff which was not expected. Now, things are cleared up: * Without -P, pending todos are always printed * With --deleted, deleted todos are printed * With -D / --done, done todos are printed * With -H / --hidden, hidden todos are printed No option influences the other. Therefore, the --deleted flag had to be added to the CLI. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Fix: Subcommand is named "deleted"Matthias Beyer2020-02-151-1/+1
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Update copyright years to 2015-2020Matthias Beyer2020-01-011-1/+1
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Use closure as suggested by clippyMatthias Beyer2019-12-231-1/+1
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Remove unnecessary to_string() callsMatthias Beyer2019-12-231-3/+3
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Remove lifetime specificationMatthias Beyer2019-12-231-1/+1
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Remove error conversion which is not necessary anymore.Matthias Beyer2019-12-221-4/+4
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Use Default implementation for constructingMatthias Beyer2019-12-221-5/+2
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Allow clippy::wrong_self_convention here for better readable codeMatthias Beyer2019-12-221-0/+1
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Rewrite else block, return predicate directlyMatthias Beyer2019-12-221-4/+3
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Simplify condition with iterator functionsMatthias Beyer2019-12-221-1/+1
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Use closure instead of always constructing objectMatthias Beyer2019-12-221-1/+1
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Simplify condition by using iterator helper functionsMatthias Beyer2019-12-221-1/+1
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Impl FromStr instead of own functionMatthias Beyer2019-12-211-0/+1
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Implement imag-todo-show table view by defaultMatthias Beyer2019-12-011-9/+73
| | | | | | By passing -T, plaintext output can be generated. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Fix: Ignore Broken Pipe errors when writing listMatthias Beyer2019-12-011-1/+9
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Merge branch 'imag-todo/ids-from-stdin' into masterMatthias Beyer2019-12-011-31/+49
|\ | | | | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
| * Rewrite list_todos() to be able to read ids from stdinMatthias Beyer2019-12-011-31/+49
| | | | | | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* | Rewrite show functionality of imag-todoMatthias Beyer2019-12-011-48/+18
|/ | | | | | | This implementation uses the handlebars crate so that the show format can be specified in the configuration file. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Fix: Only view entry if output is not a pipeMatthias Beyer2019-11-131-1/+1
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Add import functionality for taskwarrior importsMatthias Beyer2019-11-091-0/+14
| | | | Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* Reimplement imag-todoMatthias Beyer2019-11-091-110/+339
| | | | | | | | | | | | | | | | | | | | | | | | Parts of this commit were written by Leon, but in the process we needed to squash. Here's his original commit message: > Change todo listing behaviours > > This commit changes the todo binary to have the following behaviour: > - `imag-todo`: Print all non-hidden pending todos > - `imag-todo pending`: Print all non-hidden pending todos > - `imag-todo list`: Print all non-hidden non-done todos > - `--done`: Include done > - `--no-pending`: Exclude pending > > Each and every command respects the hidden attribute only on the view > layer, but still pipes the hidden entries to stdout. > > Internally, this introduces a black- and whitelist todo-state matcher, > that can be configured to match only certain todos and thereby > improves reusability of functions over the domain binary. Signed-off-by: Leon Schuermann <leon@is.currently.online> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
* imag-todo: implement ImagApplicationLeon Schuermann2019-10-261-0/+202
Signed-off-by: Leon Schuermann <leon@is.currently.online>