jschlatow / taskopen

Tool for taking notes and open urls with taskwarrior
GNU General Public License v2.0
364 stars 31 forks source link

RFE: taskopen -S #32

Closed linuxcaffe closed 11 years ago

linuxcaffe commented 11 years ago

-S as in Show

Where taskopen listings now display ("description"), the -S option would replace that with the first line of the annotation file. This might only work for text-based annotations, but it would be especially handy in viewing listings of Notes files.

jschlatow commented 11 years ago

What about

./taskopen.pl -x "head -n1" -b -t text

or '-n' instead of '-t text'?

linuxcaffe commented 11 years ago

-x "head -n1" -b

is really interesting, and sort of the idea, although the output can be an incoherent mashup. It begs for the visual context of the "description" and/or "annot" and/or "label" and/or ID to make it useful/ meaningful.

jschlatow commented 11 years ago

Then I guess a -S [cmd] would be a more general approach, with "cmd" be taken from taskopenrc if omitted. "cmd" will then be executed for each annotation and its output shown in the list.

linuxcaffe commented 11 years ago

On 27 January 2013 04:54, Johannes S. notifications@github.com wrote:

Then I guess a -s [cmd] would be a more general approach, with "cmd" be taken from taskopenrc if omitted. "cmd" will then be executed for each annotation and its output shown in the list.

I'm a bit confused, and hoping the above is a typo that should read -x [cmd] Even if it IS such a typo, I'm still confused ;-)

I've found that since the recent addition of "-b", "-x [cmd]" now requires the "batch" flag and "y/n" confirmation before executing. I liked it before, although I can see why it was a bit dangerous.

I have a couple of ideas about that :) djp

linuxcaffe commented 11 years ago

maybe, if "-T" is released from issue #34 (-E as in Entry (formerly -T as in Timestamp)) "Text" might be a better mnemonic here ??

jschlatow commented 11 years ago

No, I really meant "-S" which does almost the same as "-b -x" but shows the output interleaved with the usual output and still allows to use "-x", e.g.:

taskopen -s 'echo -n "    lines: " && wc -l' -x 'rm' -n

Can then be used for selective removing of (empy) notes files, like:

Please select an annotation: 1) Notes ("task1") -- 1 lines: 42 2) Notes ("task2") -- 2 lines: 0 Type number(s):