mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Zsh tab completion
Added missing attributes and operators.
This commit is contained in:
parent
31769a1fa4
commit
affda052c8
1 changed files with 25 additions and 9 deletions
|
@ -30,6 +30,7 @@ typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers
|
|||
_task_projects=($(task _projects))
|
||||
_task_tags=($(task _tags))
|
||||
_task_ids=($(task _ids))
|
||||
_task_zshids=( ${(f)"$(task _zshids)"} )
|
||||
_task_config=($(task _config))
|
||||
_task_columns=($(task _columns))
|
||||
_task_modifiers=(
|
||||
|
@ -51,7 +52,13 @@ _task_conjunctions=(
|
|||
'or' \
|
||||
'xor' \
|
||||
'\)' \
|
||||
'\('
|
||||
'\(' \
|
||||
'<' \
|
||||
'<=' \
|
||||
'=' \
|
||||
'!=' \
|
||||
'>=' \
|
||||
'>'
|
||||
)
|
||||
_task_cmds=($(task _commands; task _aliases))
|
||||
_task_zshcmds=( ${(f)"$(task _zshcommands)"} )
|
||||
|
@ -123,6 +130,10 @@ task_dates=(
|
|||
\)
|
||||
)
|
||||
|
||||
local -a task_zshids
|
||||
_regex_words values 'task IDs' $_task_zshids
|
||||
task_zshids=("$reply[@]")
|
||||
|
||||
_regex_words values 'task frequencies' \
|
||||
'daily:Every day' \
|
||||
'day:Every day' \
|
||||
|
@ -130,7 +141,7 @@ _regex_words values 'task frequencies' \
|
|||
'weekly:Every week' \
|
||||
'biweekly:Every two weeks' \
|
||||
'fortnight:Every two weeks' \
|
||||
+ 'monthly:Every month' \
|
||||
'monthly:Every month' \
|
||||
'quarterly:Every three months' \
|
||||
'semiannual:Every six months' \
|
||||
'annual:Every year' \
|
||||
|
@ -156,20 +167,25 @@ task_freqs=(
|
|||
# attributes
|
||||
local -a task_attributes
|
||||
_regex_words -t ':' default 'task attributes' \
|
||||
'des*cription:Task description text' \
|
||||
'status:Status of task - pending, completed, deleted, waiting' \
|
||||
'pro*ject:Project name:$task_projects' \
|
||||
'du*e:Due date:$task_dates' \
|
||||
'wa*it:Date until task becomes pending:$task_dates' \
|
||||
're*cur:Recurrence frequency:$task_freqs' \
|
||||
'pri*ority:priority:$task_priorities' \
|
||||
'du*e:Due date:$task_dates' \
|
||||
're*cur:Recurrence frequency:$task_freqs' \
|
||||
'un*til:Expiration date:$task_dates' \
|
||||
'fg:Foreground color' \
|
||||
'bg:Background color' \
|
||||
'li*mit:Desired number of rows in report'
|
||||
'li*mit:Desired number of rows in report' \
|
||||
'wa*it:Date until task becomes pending:$task_dates' \
|
||||
'ent*ry:Date task was created:$task_dates' \
|
||||
'end:Date task was completed/deleted:$task_dates' \
|
||||
'st*art:Date task was started:$task_dates' \
|
||||
'sc*heduled:Date task is scheduled to start:$task_dates' \
|
||||
'dep*ends:Other tasks that this task depends upon:$task_zshids'
|
||||
task_attributes=("$reply[@]")
|
||||
|
||||
args=(
|
||||
\( "$task_attributes[@]" \|
|
||||
\( /'(project|due|wait|recur|priority|until|fg|bg|limit).'/- \( /$'[^:]#:'/ ":default:modifiers:compadd -S ':' -a _task_modifiers" \) \) \|
|
||||
\( /'(project|description|status|entry|end|start|scheduled|depends|due|wait|recur|priority|until|limit).'/- \( /$'[^:]#:'/ ":default:modifiers:compadd -S ':' -a _task_modifiers" \) \) \|
|
||||
\( /'(rc).'/- \( /$'[^:]#:'/ ":arguments:config:compadd -S ':' -a _task_config" \) \) \|
|
||||
\( /'(+|-)'/- \( /"$word"/ ":values:remove tag:compadd -a _task_tags" \) \) \|
|
||||
\( /"$word"/ \)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue