Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Filter Precedence" page explanation of grouping of report and CLI filters #876

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions content/docs/filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,32 +106,28 @@ Which has an implicit conjunction:

status:pending and project:Home

Now suppose we wanted to use a disjunction filter with the `ls` command:
Now if we want to use a disjunction filter with the `ls` command:

$ task project:Home or project:Garden list

This is interpreted as:

status:pending and project:Home or project:Garden

Do you see the precedence problem?
The intended filter is this:

status:pending and (project:Home or project:Garden)

which includes the parentheses to group the disjunction.
Going back to the original filter, we now know that it needs this form:

$ task (project:Home or project:Garden) list
Now suppose we wanted to use the filter above with the `all` command:

$ task status:pending and (project:Home or project:Garden) all
...

Except now, we have one more problem - those parentheses have special meaning to the shell, and must be escaped in one of the following ways:
Now, we have one more problem - those parentheses have special meaning to the shell, and must be escaped in one of the following ways:

$ task \(project:Home or project:Garden\) list
$ task status:pending and \(project:Home or project:Garden\) list
...
$ task '(project:Home or project:Garden)' list
$ task status:pending and '(project:Home or project:Garden)' list
...
$ task "(project:Home or project:Garden)" list
$ task status:pending and "(project:Home or project:Garden)" list

Note that there are many characters used by the taskwarrior command line that have special meaning to the shell, and as such must be properly escaped, as [described here](../escapes/).

Expand Down