topydo
topydo copied to clipboard
filter expression with _or_
Hello,
Currently tasks must match all elements in a filter expression (separated by spaces):
As described here:
A filter expression consists of several terms separated by whitespace. A todo item must match each term in order to be selected/shown.
What if we could filter based on multiple expressions? Perhaps a comma could be used, like this:
topydo ls +MyProject,+MyOtherProject
This would list tasks from either project.
We've discussed such feature with @bram85 some time ago. It needs major changes in how expressions are evaluated. Seems like we would need to write real tokenizer and parser for it to work properly and with backward compatibility. I believe this won't happen before 0.13.
@colinsullivan Also syntax from your example won't play well with something more complex:
topydo ls +MyProject, +MyOtherProject +YetAnotherProject
- how it should be evaluated?
Is it: +MyProject OR (+MyOtherPoject AND +YetAnotherProject)
or maybe it should be: +MyProject OR +MyOtherProject AND +YetAnotherProject
?
My two-pennyworth - any parsing which assumes you understand the precedence of the operators is doomed to burn someone, sometime (me probably!). Some sort of parenthesis should be allowed even if not mandatory, from a usability perspective. As most of the time I suspect it will be used in config files for columns rather than for on-the-fly evaluations, it doesn't matter (to me anyway) if it is a bit clunky with quoted parentheses.
Agreed, it's on my personal wish list too. As @mruwek explained, it should be done properly by parsing expressions including parentheses, while still maintaining backward compatibility with the current expressions.
Bump. Any progress on this feature? Still would be great to have. Thanks for a great tool!