From affda052c86f75b7f48299318545be3cce255b04 Mon Sep 17 00:00:00 2001 From: Johannes Schlatow Date: Mon, 30 Jul 2012 11:55:42 +0200 Subject: [PATCH] Zsh tab completion Added missing attributes and operators. --- scripts/zsh/_task | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/scripts/zsh/_task b/scripts/zsh/_task index 02ef6096b..c058f494f 100644 --- a/scripts/zsh/_task +++ b/scripts/zsh/_task @@ -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"/ \)