Skip to content
Merged
Show file tree
Hide file tree
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
42 changes: 19 additions & 23 deletions doc/man/task.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,9 @@ from tasks, or the system. Supported DOM references are:
Note that the 'rc.<name>' reference may need to be escaped using '--' to prevent
the reference from being interpreted as an override.

Note that if the DOM reference is not valid, or the reference evaluates to a
missing value, the command exits with 1.
Note that if the DOM reference is not valid, the command exits with 2. If the
reference evaluates to a missing value, such as an unset attribute or a task
that does not exist, the output is empty and the command exits with 0.

Additionally, some components of the attributes of particular types may be
extracted by DOM references.
Expand Down Expand Up @@ -1103,15 +1104,14 @@ and
respectively. The negation operator is
.IR ! .

Note that the parentheses are required when using a logical operator other than
the 'and' operator. The reason is that some reports contain filters that must
be combined with the command line. Consider this example:
Some reports contain filters that are combined with the command line filter.
Consider this example:

.nf
task project:Home or project:Garden list
.fi

While this looks correct, it is not. The 'list' report contains a filter of:
The 'list' report contains a filter of:
Comment thread
brzzdev marked this conversation as resolved.

.nf
task show report.list.filter
Expand All @@ -1121,29 +1121,25 @@ While this looks correct, it is not. The 'list' report contains a filter of:
report.list.filter status:pending
.fi

Which means the example is really:
Taskwarrior puts parentheses around the command line filter before combining
it with the report filter, so the example is really:

.nf
task status:pending project:Home or project:Garden list
.fi

The implied 'and' operator makes it:

.nf
task status:pending and project:Home or project:Garden list
task status:pending and ( project:Home or project:Garden ) list
.fi

This is a precedence error - the 'and' and 'or' need to be grouped using
parentheses, like this:
No parentheses are needed here. They are still needed when you mix 'and'
and 'or' in your own filter, because 'and' binds more tightly than 'or'.
This example lists all Home tasks, but only the Garden tasks tagged 'weekend':

.nf
task status:pending and ( project:Home or project:Garden ) list
task project:Home or project:Garden +weekend list
.fi

The original example therefore must be entered as:
To list the 'weekend' tasks in either project, group the 'or':

.nf
task '( project:Home or project:Garden )' list
task '( project:Home or project:Garden )' +weekend list
.fi

This includes quotes to escape the parentheses, so that the shell doesn't
Expand Down Expand Up @@ -1201,27 +1197,27 @@ Day number with ordinal
.fi

.TP
Start of next (work) week (Monday), calendar week (Sunday or Monday), month, quarter and year
Start of current week or work week (Monday), month, quarter and year
.nf
task ... due:sow
task ... due:soww
task ... due:socw
task ... due:som
task ... due:soq
task ... due:soy
.fi

.TP
End of current (work) week (Friday), calendar week (Saturday or Sunday), month, quarter and year
End of current week (Sunday), work week (Friday), month, quarter and year
.nf
task ... due:eow
task ... due:eoww
task ... due:eocw
task ... due:eom
task ... due:eoq
task ... due:eoy
.fi

On a Sunday, soww and eoww refer to the work week that starts the next day.

.TP
At some point or later
.nf
Expand Down
6 changes: 5 additions & 1 deletion doc/man/taskrc.5.in
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,11 @@ Enables ISO-8601 date support. The default value is "1".
.TP
.B weekstart=Sunday
Determines the day a week starts. Valid values are Sunday or Monday only. The
default value is "Sunday".
default value is "Sunday". This affects the layout of the "task calendar"
command, week numbers, and the day that a week date such as 2026-W02 refers to.
With Monday, week numbers follow ISO-8601. It does not affect named dates
such as sow and eow, or the WEEK virtual tag, which always use a week from
Monday to Sunday.

.TP
.B displayweeknumber=1
Expand Down
2 changes: 0 additions & 2 deletions scripts/fish/task.fish
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,11 @@ set __fish_task_static_dates 'today:Today' \
'tomorrow:Tomorrow' \
'sow:Start of week' \
'soww:Start of work week' \
'socw:Start of calendar week' \
'som:Start of month' \
'soq:Start of quarter' \
'soy:Start of year' \
'eow:End of week' \
'eoww:End of work week' \
'eocw:End of calendar week' \
'eom:End of month' \
'eoq:End of quarter' \
'eoy:End of year' \
Expand Down
2 changes: 0 additions & 2 deletions scripts/zsh/_task
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,11 @@ _task_filter() {
'tom*orrow:Tomorrow' \
'sow:Start of week' \
'soww:Start of work week' \
'socw:Start of calendar week' \
'som:Start of month' \
'soq:Start of quarter' \
'soy:Start of year' \
'eow:End of week' \
'eoww:End of work week' \
'eocw:End of calendar week' \
'eom:End of month' \
'eoq:End of quarter' \
'eoy:End of year' \
Expand Down
Loading