Closed evilham closed 6 years ago
Shamelessly pinging people who may be interested in this: @AnotherKamila @robertbasden
Sounds good to me, somebody should do something :D
I don't see right now how exactly to actually get at the values of the filters (task _get
is actually for something else, task $something show
does work but would require parsing). I don't know how to get the info out in a machine-friendly format.
Escaping should not be necessary, IIRC, but better check :D
Is it for sth else? :-D I just checked it and it gives me the things I want in that order and without the fancy formatting from show
.
Doesn't work for me:
> task _get context
'context' is not a DOM reference.
> task --version
2.5.0
There is the machine-readable task _show
, from which you can grep out the context and next filters. I still haven't found a clean way to get the current context though.
Crap, rc.context
:D sorry :D you're right, works. I should sleep more :D
Nah, you probably got it from the email notification, I actually mistyped first :-D. I just thought maybe you knew sth I was missing :).
Check the new branch for code implementing this behaviour :). https://github.com/AnotherKamila/tasksched/tree/25-active-filters
@evilham check the new PR I made out of your branch ;-) #26. Next time you can do that yourself, if I create it, I can't assign me to review it :D
Probably should have done that ^^. Check the changed thingy.
Right now tasksched basically uses
task export
and, if I recall correctly, it filters by task state on the ELM side of things.This complicates things a bit, like: what about context support? Or custom
next
reports?I'd think it's kind of to be expected that what is shown on
task
and what is shown on tasksched's interface are the same, which means supporting these two things.One way I'd go about that, would be replacing the
task export
call with three calls:task _get rc.context
: will return the current context or nothingtask _get rc.context.$CONTEXT
: will return the filter for the current context ORtask _get rc.report.next.filter
will return the filter for thenext
reporttask $FILTER export
: will return (and pass to tasksched) the filtered tasksIf I recall correctly, spawn should take care of shell escaping, it should be checked in any case (filters contain stuff like
!
and context names can be "weird").What do people using
tasksched
think? :-)