5da609e2c96c100c3c862e83f96e618d693c934f
- Author
- Pete Clark <pete.clark@gmail.com>
- Committer
- Pete Clark <pete.clark@gmail.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/taskwarrior/_task b/plugins/taskwarrior/_task
2new file mode 100644
3index 0000000000000000000000000000000000000000..5bffa9119e439c633ef8fd156b7233fd4ed9b61e
4--- /dev/null
5+++ b/plugins/taskwarrior/_task
6@@ -0,0 +1,280 @@
7+#compdef task
8+#
9+# zsh completion for taskwarrior
10+#
11+# Copyright 2010 - 2011 Johannes Schlatow
12+# Copyright 2009 P.C. Shyamshankar
13+# All rights reserved.
14+#
15+# This script is part of the taskwarrior project.
16+#
17+# This program is free software; you can redistribute it and/or modify it under
18+# the terms of the GNU General Public License as published by the Free Software
19+# Foundation; either version 2 of the License, or (at your option) any later
20+# version.
21+#
22+# This program is distributed in the hope that it will be useful, but WITHOUT
23+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
24+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
25+# details.
26+#
27+# You should have received a copy of the GNU General Public License along with
28+# this program; if not, write to the
29+#
30+# Free Software Foundation, Inc.,
31+# 51 Franklin Street, Fifth Floor,
32+# Boston, MA
33+# 02110-1301
34+# USA
35+#
36+typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers
37+_task_projects=($(task _projects))
38+_task_tags=($(task _tags))
39+_task_ids=($(task _ids))
40+_task_config=($(task _config))
41+_task_modifiers=(
42+ 'before' \
43+ 'after' \
44+ 'none' \
45+ 'any' \
46+ 'is' \
47+ 'isnt' \
48+ 'has' \
49+ 'hasnt' \
50+ 'startswith' \
51+ 'endswith' \
52+ 'word' \
53+ 'noword'
54+)
55+_task_cmds=($(task _commands))
56+_task_zshcmds=( ${(f)"$(task _zshcommands)"} )
57+
58+
59+_task_idCmds=(
60+ 'append' \
61+ 'prepend' \
62+ 'annotate' \
63+ 'denotate' \
64+ 'edit' \
65+ 'duplicate' \
66+ 'info' \
67+ 'start' \
68+ 'stop' \
69+ 'done'
70+)
71+
72+_task_idCmdsDesc=(
73+ 'append:Appends more description to an existing task.' \
74+ 'prepend:Prepends more description to an existing task.' \
75+ 'annotate:Adds an annotation to an existing task.' \
76+ 'denotate:Deletes an annotation of an existing task.' \
77+ 'edit:Launches an editor to let you modify a task directly.' \
78+ 'duplicate:Duplicates the specified task, and allows modifications.' \
79+ 'info:Shows all data, metadata for specified task.' \
80+ 'start:Marks specified task as started.' \
81+ 'stop:Removes the start time from a task.' \
82+ 'done:Marks the specified task as completed.'
83+)
84+
85+_task() {
86+ _arguments -s -S \
87+ "*::task command:_task_commands"
88+ return 0
89+}
90+
91+local -a reply args word
92+word=$'[^\0]#\0'
93+
94+# priorities
95+local -a task_priorities
96+_regex_words values 'task priorities' \
97+ 'H:High' \
98+ 'M:Middle' \
99+ 'L:Low'
100+task_priorities=("$reply[@]")
101+
102+# projects
103+local -a task_projects
104+task_projects=(
105+ /"$word"/