Zsh tab completion
Added missing attributes and operators.
This commit is contained in:
@@ -30,6 +30,7 @@ typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers
|
|||||||
_task_projects=($(task _projects))
|
_task_projects=($(task _projects))
|
||||||
_task_tags=($(task _tags))
|
_task_tags=($(task _tags))
|
||||||
_task_ids=($(task _ids))
|
_task_ids=($(task _ids))
|
||||||
|
_task_zshids=( ${(f)"$(task _zshids)"} )
|
||||||
_task_config=($(task _config))
|
_task_config=($(task _config))
|
||||||
_task_columns=($(task _columns))
|
_task_columns=($(task _columns))
|
||||||
_task_modifiers=(
|
_task_modifiers=(
|
||||||
@@ -51,7 +52,13 @@ _task_conjunctions=(
|
|||||||
'or' \
|
'or' \
|
||||||
'xor' \
|
'xor' \
|
||||||
'\)' \
|
'\)' \
|
||||||
'\('
|
'\(' \
|
||||||
|
'<' \
|
||||||
|
'<=' \
|
||||||
|
'=' \
|
||||||
|
'!=' \
|
||||||
|
'>=' \
|
||||||
|
'>'
|
||||||
)
|
)
|
||||||
_task_cmds=($(task _commands; task _aliases))
|
_task_cmds=($(task _commands; task _aliases))
|
||||||
_task_zshcmds=( ${(f)"$(task _zshcommands)"} )
|
_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' \
|
_regex_words values 'task frequencies' \
|
||||||
'daily:Every day' \
|
'daily:Every day' \
|
||||||
'day:Every day' \
|
'day:Every day' \
|
||||||
@@ -130,7 +141,7 @@ _regex_words values 'task frequencies' \
|
|||||||
'weekly:Every week' \
|
'weekly:Every week' \
|
||||||
'biweekly:Every two weeks' \
|
'biweekly:Every two weeks' \
|
||||||
'fortnight:Every two weeks' \
|
'fortnight:Every two weeks' \
|
||||||
+ 'monthly:Every month' \
|
'monthly:Every month' \
|
||||||
'quarterly:Every three months' \
|
'quarterly:Every three months' \
|
||||||
'semiannual:Every six months' \
|
'semiannual:Every six months' \
|
||||||
'annual:Every year' \
|
'annual:Every year' \
|
||||||
@@ -156,20 +167,25 @@ task_freqs=(
|
|||||||
# attributes
|
# attributes
|
||||||
local -a task_attributes
|
local -a task_attributes
|
||||||
_regex_words -t ':' default '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' \
|
'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' \
|
'pri*ority:priority:$task_priorities' \
|
||||||
|
'du*e:Due date:$task_dates' \
|
||||||
|
're*cur:Recurrence frequency:$task_freqs' \
|
||||||
'un*til:Expiration date:$task_dates' \
|
'un*til:Expiration date:$task_dates' \
|
||||||
'fg:Foreground color' \
|
'li*mit:Desired number of rows in report' \
|
||||||
'bg:Background color' \
|
'wa*it:Date until task becomes pending:$task_dates' \
|
||||||
'li*mit:Desired number of rows in report'
|
'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[@]")
|
task_attributes=("$reply[@]")
|
||||||
|
|
||||||
args=(
|
args=(
|
||||||
\( "$task_attributes[@]" \|
|
\( "$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" \) \) \|
|
\( /'(rc).'/- \( /$'[^:]#:'/ ":arguments:config:compadd -S ':' -a _task_config" \) \) \|
|
||||||
\( /'(+|-)'/- \( /"$word"/ ":values:remove tag:compadd -a _task_tags" \) \) \|
|
\( /'(+|-)'/- \( /"$word"/ ":values:remove tag:compadd -a _task_tags" \) \) \|
|
||||||
\( /"$word"/ \)
|
\( /"$word"/ \)
|
||||||
|
|||||||
Reference in New Issue
Block a user