taskwarrior icon indicating copy to clipboard operation
taskwarrior copied to clipboard

Delegation of sub-commands

Open madduck opened this issue 6 years ago • 4 comments

It would be great if I could add subcommands to task, e.g. if I call task foobar and there is an executable task-foobar in $PATH, then execute that instead. This is how Git and many other tools work, and it's a great way to extend functionality.

I thought this could maybe be done using the following configuration

alias.foobar=execute task-foobar

and there would be merit to requiring such explicit configuration, but it doesn't actually work, possibly due to #2105.

madduck avatar Jan 30 '19 22:01 madduck

What functionality does this provide in this case:

$ task foobar ...

over this case:

$ task-foobar ...

pbeckingham avatar Feb 07 '19 21:02 pbeckingham

It's easier not to have to remember what subcommands need a dash, and which don't? Git and several other tools have really paved the way here…

madduck avatar Feb 08 '19 00:02 madduck

It should work, and I agree, that #2105 is a likely cause. Keeping this open to make sure.

pbeckingham avatar Aug 11 '19 19:08 pbeckingham

Another nice thing is that all filters could be handled by taskwarrior before invoking the subcommand, then the task ids could be passed to the subcommand somehow (e.g. stdin, like done for hooks?).

Example:

task +mytag foobar

guludo avatar Nov 04 '22 14:11 guludo