taskwarrior icon indicating copy to clipboard operation
taskwarrior copied to clipboard

(Also) Support `task <filter> [<reportname>] export`

Open m-gris opened this issue 1 year ago • 2 comments

This is a sequel to #2576 , which did introduce in a "nice improvement", by supporting task <filter> export [<reportname>].

However, the syntax feels, to me at least, a bit "un-intuitive".

task <filter> [<reportname>] export would probably feel more intuitive to many unix users, i.e sort-of "piping" the output of task <filter> [<reportname>] to export.

m-gris avatar Jun 25 '24 10:06 m-gris

The proposed change would lead to ambiguous behaviour, as the name of the report can also be a valid plaintext filter query, i.e.:

task export blocked

exports all tasks according to the filter of the blocked report, while

task blocked export

exports all the tasks that have word "blocked" in their description. Both are valid use cases.

tbabej avatar Nov 27 '24 03:11 tbabej

This issue does not complain about this, but I can see how that would lead to some amount of confusing behaviour. Perhaps what should be done is the following - if the description filter is a single word, matching a report name (like blocked), we should emit a warning footnote to remind users that syntax to refer to report filters is different.

$ task blocked export
[
]
The specified description one-word filter "blocked" is also a name of a report. Did you mean "task export blocked"?

That said, not a big fan of informational messages with task export, which is often used programmatically, at the very least this needs to be emitted on stderr.

tbabej avatar Nov 27 '24 03:11 tbabej