Mercurial > hg
annotate contrib/zsh_completion @ 3539:a6dd7ab568cc
zsh: make option lists more compact
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Wed, 25 Oct 2006 16:35:35 -0700 |
parents | 060aefba4459 |
children | ee6b8de6df3c |
rev | line source |
---|---|
1362 | 1 #compdef hg |
2 | |
3 # Zsh completion script for mercurial. Rename this file to _hg and copy | |
4 # it into your zsh function path (/usr/share/zsh/site-functions for | |
5 # instance) | |
6 # | |
7 # Copyright (C) 2005 Steve Borho | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
8 # Copyright (C) 2006 Brendan Cully |
1362 | 9 # |
10 # This is free software; you can redistribute it and/or modify it under | |
11 # the terms of the GNU General Public License as published by the Free | |
12 # Software Foundation; either version 2 of the License, or (at your | |
13 # option) any later version. | |
14 # | |
15 | |
16 local curcontext="$curcontext" state line | |
3537 | 17 local repos newFiles addedFiles commitMessage |
18 typeset -A _hg_cmd_globals | |
19 | |
20 _hg() { | |
21 local cmd | |
22 integer i=2 | |
23 _hg_cmd_globals=() | |
24 | |
25 while (( i < $#words )) | |
26 do | |
27 case "$words[$i]" in | |
28 -R|--repository|--cwd|--config) | |
29 # pass along arguments to hg completer | |
30 _hg_cmd_globals+="$words[$i]" | |
31 _hg_cmd_globals+="$words[$i+1]" | |
32 (( i += 2 )) | |
33 continue | |
34 ;; | |
35 -R*) | |
36 _hg_cmd_globals+="$words[$i]" | |
37 (( i++ )) | |
38 continue | |
39 ;; | |
40 -*) | |
41 # skip option | |
42 (( i++ )) | |
43 continue | |
44 ;; | |
45 esac | |
46 if [[ -z "$cmd" ]] | |
47 then | |
48 cmd="$words[$i]" | |
49 words[$i]=() | |
50 (( CURRENT-- )) | |
51 fi | |
52 (( i++ )) | |
53 done | |
54 | |
55 if [[ -z "$cmd" ]] | |
56 then | |
57 _arguments -s -w : $_hg_global_opts \ | |
58 ':mercurial command:_hg_commands' | |
59 return | |
60 fi | |
61 | |
62 # resolve abbreviations and aliases | |
63 if ! (( $+functions[_hg_cmd_${cmd}] )) | |
64 then | |
65 local cmdexp | |
66 (( $#_hg_cmd_list )) || _hg_get_commands | |
67 | |
68 cmdexp=$_hg_cmd_list[(r)${cmd}*] | |
69 if [[ $cmdexp == $_hg_cmd_list[(R)${cmd}*] ]] | |
70 then | |
71 # might be nice to rewrite the command line with the expansion | |
72 cmd="$cmdexp" | |
73 fi | |
74 if [[ -n $_hg_alias_list[$cmd] ]] | |
75 then | |
76 cmd=$_hg_alias_list[$cmd] | |
77 fi | |
78 fi | |
79 | |
80 if (( $+functions[_hg_cmd_${cmd}] )) | |
81 then | |
82 curcontext="${curcontext%:*:*}:hg-${cmd}:" | |
83 _hg_cmd_${cmd} | |
84 return | |
85 fi | |
86 } | |
3497
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3496
diff
changeset
|
87 |
3537 | 88 _hg_get_commands() { |
89 typeset -ga _hg_cmd_list | |
90 typeset -gA _hg_alias_list | |
91 local hline cmd cmdalias | |
92 _call_program help hg --verbose help | while read -A hline | |
93 do | |
94 cmd="$hline[1]" | |
95 case $cmd in | |
96 *:) | |
97 cmd=${cmd%:} | |
98 _hg_cmd_list+=($cmd) | |
99 ;; | |
100 *,) | |
101 cmd=${cmd%,} | |
102 _hg_cmd_list+=($cmd) | |
103 integer i=2 | |
104 while (( i <= $#hline )) | |
105 do | |
106 cmdalias=${hline[$i]%(:|,)} | |
107 _hg_cmd_list+=($cmdalias) | |
108 _hg_alias_list+=($cmdalias $cmd) | |
109 (( i++ )) | |
110 done | |
111 ;; | |
112 esac | |
113 done | |
114 } | |
115 | |
116 _hg_commands() { | |
117 (( $#_hg_cmd_list )) || _hg_get_commands | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
118 _describe -t hg-commands 'mercurial command' _hg_cmd_list |
3537 | 119 } |
120 | |
121 _hg_tags() { | |
122 typeset -a tags | |
123 local tag rev | |
124 | |
125 _hg_cmd tags 2> /dev/null | while read tag rev | |
126 do | |
127 tags+=($tag) | |
128 done | |
129 (( $#tags )) && _describe -t hg-tags 'tags' tags | |
130 } | |
131 | |
132 _hg_status() { | |
133 status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 .)"}) | |
134 } | |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
135 |
3537 | 136 _hg_unknown() { |
137 typeset -a status_files | |
138 _hg_status u | |
139 (( $#status_files )) && _describe -t hg-unknown-files 'unknown files' status_files | |
140 } | |
141 | |
142 _hg_missing() { | |
143 typeset -a status_files | |
144 _hg_status d | |
145 (( $#status_files )) && _describe -t hg-missing-files 'missing files' status_files | |
146 } | |
147 | |
148 _hg_addremove() { | |
149 _alternative "unknown files:unknown files:_hg_unknown" \ | |
150 "missing files:missing files:_hg_missing" | |
151 } | |
152 | |
153 _hg_paths() { | |
154 typeset -a paths pnames | |
155 _hg_cmd paths 2> /dev/null | while read -A pnames | |
156 do | |
157 paths+=($pnames[1]) | |
158 done | |
159 (( $#paths )) && _describe -t hg-paths 'repository aliases' paths | |
160 } | |
161 | |
162 _hg_remote() { | |
163 _alternative 'repository aliases:repository aliases:_hg_paths' \ | |
164 'directory:directory:_files -/' | |
165 } | |
166 | |
167 _hg_qseries() { | |
168 typeset -a patches | |
169 patches=($(_hg_cmd qseries)) | |
170 (( $#patches )) && _describe -t hg-patches 'patches' patches | |
171 } | |
172 | |
173 _hg_qapplied() { | |
174 typeset -a patches | |
175 patches=($(_hg_cmd qapplied)) | |
176 (( $#patches )) && _describe -t hg-applied-patches 'applied patches' patches | |
177 } | |
178 | |
179 _hg_qunapplied() { | |
180 typeset -a patches | |
181 patches=($(_hg_cmd qunapplied)) | |
182 (( $#patches )) && _describe -t hg-unapplied-patches 'unapplied patches' patches | |
3497
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3496
diff
changeset
|
183 } |
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3496
diff
changeset
|
184 |
3537 | 185 # Common options |
186 _hg_global_opts=( | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
187 '(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/' |
3537 | 188 '--cwd[change working directory]:new working directory:_files -/' |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
189 '(--noninteractive -y)'{-y,--noninteractive}'[do not prompt, assume yes for any required answers]' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
190 '(--verbose -v)'{-v,--verbose}'[enable additional output]' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
191 '(--quiet -q)'{-q,--quiet}'[suppress output]' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
192 '(--help -h)'{-h,--help}'[display help and exit]' |
3537 | 193 '--debug[debug mode]' |
194 '--debugger[start debugger]' | |
195 '--traceback[print traceback on exception]' | |
196 '--time[time how long the command takes]' | |
197 '--profile[profile]' | |
198 '--version[output version information and exit]' | |
199 ) | |
200 | |
201 _hg_pat_opts=( | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
202 '*'{-I+,--include}'[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
203 '*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/') |
3537 | 204 |
205 _hg_diff_opts=( | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
206 '(--text -a)'{-a,--text}'[treat all files as text]' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
207 '(--git -g)'{-g,--git}'[use git extended diff format]' |
3537 | 208 "--nodates[don't include dates in diff headers]") |
209 | |
210 _hg_dryrun_opts=( | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
211 '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]') |
3537 | 212 |
213 _hg_style_opts=( | |
214 '--style[display using template map file]:' | |
215 '--template[display with template]:') | |
216 | |
217 _hg_commit_opts=( | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
218 '(-m --message -l --logfile --edit -e)'{-e,--edit}'[edit commit message]' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
219 '(-e --edit -l --logfile --message -m)'{-m+,--message}'[use <text> as commit message]:message:' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
220 '(-e --edit -m --message --logfile -l)'{-l+,--logfile}'[read the commit message from <file>]:log file:_files') |
3537 | 221 |
222 _hg_remote_opts=( | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
223 '(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:' |
3537 | 224 '--remotecmd[specify hg command to run on the remote side]:') |
225 | |
226 _hg_cmd() { | |
227 _call_program hg hg "$_hg_cmd_globals[@]" "$@" | |
228 } | |
229 | |
230 _hg_cmd_add() { | |
231 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ | |
232 '*:unknown files:_hg_unknown' | |
233 } | |
234 | |
235 _hg_cmd_addremove() { | |
236 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
237 '(--similarity -s)'{-s+,--similarity}'[guess renamed files by similarity (0<=s<=100)]:' \ |
3537 | 238 '*:unknown or missing files:_hg_addremove' |
239 } | |
240 | |
241 _hg_cmd_annotate() { | |
242 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
243 '(--rev -r)'{-r+,--rev}'[annotate the specified revision]:revision:_hg_tags' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
244 '(--follow -f)'{-f,--follow}'[follow file copies and renames]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
245 '(--text -a)'{-a,--text}'[treat all files as text]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
246 '(--user -u)'{-u,--user}'[list the author]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
247 '(--date -d)'{-d,--date}'[list the date]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
248 '(--number -n)'{-n,--number}'[list the revision number (default)]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
249 '(--changeset -c)'{-c,--changeset}'[list the changeset]' \ |
3537 | 250 '*:files:_files -W $(_hg_cmd root)' |
251 } | |
252 | |
253 _hg_cmd_archive() { | |
254 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
255 '--no-decode[do not pass files through decoders]' \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
256 '(--prefix -p)'{-p+,--prefix}'[directory prefix for files in archive]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
257 '(--rev -r)'{-r+,--rev}'[revision to distribute]:revision:_hg_tags' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
258 '(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \ |
3537 | 259 '*:destination:_files' |
260 } | |
261 | |
262 _hg_cmd_bundle() { | |
263 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
264 '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \ |
3537 | 265 '(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_tags' \ |
266 ':output file:_files' \ | |
267 ':destination repository:_files -/' | |
268 } | |
269 | |
270 _hg_cmd_cat() { | |
271 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
272 '(--output -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
273 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ |
3537 | 274 '*:file:_files -W $(_hg_cmd root)' |
275 } | |
276 | |
277 _hg_cmd_clone() { | |
278 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
279 '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
280 '(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \ |
3537 | 281 '--uncompressed[use uncompressed transfer (fast over LAN)]' \ |
282 ':source repository:_hg_remote' \ | |
283 ':destination:_files -/' | |
284 } | |
285 | |
286 _hg_cmd_commit() { | |
287 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
288 '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
289 '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
290 '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_file -g \*.txt' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
291 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
292 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ |
3537 | 293 '*:file:_files -W $(_hg_cmd root)' |
294 } | |
295 | |
296 _hg_cmd_copy() { | |
297 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
298 '(--after -A)'{-A,--after}'[record a copy that has already occurred]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
299 '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ |
3537 | 300 '*:file:_files -W $(_hg_cmd root)' |
301 } | |
302 | |
303 _hg_cmd_diff() { | |
304 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \ | |
305 '*'{-r,--rev}'+[revision]:revision:_hg_tags ' \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
306 '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
307 '(--ignore-all-space -w)'{-w,--ignore-all-space}'[ignore white space when comparing lines]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
308 '(--ignore-space-change -b)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
309 '(--ignore-blank-lines -B)'{-B,--ignore-blank-lines}'[ignore changes whose lines are all blank]' \ |
3537 | 310 '*:file:_files -W $(_hg_cmd root)' |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
311 } |
1362 | 312 |
3537 | 313 _hg_cmd_export() { |
314 _arguments -s -w : $_hg_global_opts $_hg_diff_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
315 '(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ |
3537 | 316 '--switch-parent[diff against the second parent]' \ |
317 '*:revision:_hg_tags' | |
318 } | |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
319 |
3537 | 320 _hg_cmd_grep() { |
321 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
322 '(--print0 -0)'{-0,--print0}'[end filenames with NUL]' \ |
3537 | 323 '--all[print all revisions with matches]' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
324 '(--follow -f)'{-f,--follow}'[follow changeset or file history]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
325 '(--ignore-case -i)'{-i,--ignore-case}'[ignore case when matching]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
326 '(--files-with-matches -l)'{-l,--files-with-matches}'[print only filenames and revs that match]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
327 '(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
328 '*'{-r+,--rev}'[search in given revision range]:revision:_hg_tags' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
329 '(--user -u)'{-u,--user}'[print user who committed change]' \ |
3537 | 330 '*:search pattern:_files -W $(_hg_cmd root)' |
331 } | |
1362 | 332 |
3537 | 333 _hg_cmd_heads() { |
334 _arguments -s -w : $_hg_global_opts $_hg_style_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
335 '(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_tags' |
3537 | 336 } |
337 | |
338 _hg_cmd_help() { | |
339 _arguments -s -w : $_hg_global_opts \ | |
340 '*:mercurial command:_hg_commands' | |
341 } | |
1362 | 342 |
3537 | 343 _hg_cmd_import() { |
344 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
345 '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
346 '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
347 '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \ |
3537 | 348 '*:patch:_files' |
349 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
350 |
3537 | 351 _hg_cmd_incoming() { |
352 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
353 '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
354 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
355 '(--patch -p)'{-p,--patch}'[show patch]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
356 '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
357 '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ |
3537 | 358 '--bundle[file to store the bundles into]:bundle file:_files' \ |
359 ':source:_hg_remote' | |
360 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
361 |
3537 | 362 _hg_cmd_init() { |
363 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ | |
364 ':dir:_files -/' | |
365 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
366 |
3537 | 367 _hg_cmd_locate() { |
368 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
369 '(--rev -r)'{-r+,--rev}'[search repository as it stood at revision]:revision:_hg_tags' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
370 '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
371 '(--fullpath -f)'{-f,--fullpath}'[print complete paths]' \ |
3537 | 372 '*:search pattern:_files -W $(_hg_cmd root)' |
373 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
374 |
3537 | 375 _hg_cmd_log() { |
376 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_style_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
377 '(--follow --follow-first -f)'{-f,--follow}'[follow changeset or history]' \ |
3537 | 378 '(-f --follow)--follow-first[only follow the first parent of merge changesets]' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
379 '(--copies -C)'{-C,--copies}'[show copied files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
380 '(--keyword -k)'{-k+,--keyword}'[search for a keyword]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
381 '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ |
3537 | 382 '*'{-r,--rev}'[show the specified revision or range]:revision:_hg_tags' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
383 '(--no-merges -M)'{-M,--no-merges}'[do not show merges]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
384 '(--only-merges -m)'{-m,--only-merges}'[show only merges]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
385 '(--patch -p)'{-p,--patch}'[show patch]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
386 '(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_tags' \ |
3537 | 387 '*:files:_files -W $(_hg_cmd root)' |
388 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
389 |
3537 | 390 _hg_cmd_manifest() { |
391 _arguments -s -w : $_hg_global_opts \ | |
392 ':revision:_hg_tags' | |
393 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
394 |
3537 | 395 _hg_cmd_outgoing() { |
396 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
397 '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
398 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
399 '(--patch -p)'{-p,--patch}'[show patch]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
400 '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
401 '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ |
3537 | 402 ':destination:_hg_remote' |
403 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
404 |
3537 | 405 _hg_cmd_parents() { |
406 _arguments -s -w : $_hg_global_opts $_hg_style_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
407 '(--rev -r)'{-r+,--rev}'[show parents of the specified rev]:revision:_hg_tags' \ |
3537 | 408 ':revision:_hg_tags' |
409 } | |
410 | |
411 _hg_cmd_paths() { | |
412 _arguments -s -w : $_hg_global_opts \ | |
413 ':path:_hg_paths' | |
414 } | |
415 | |
416 _hg_cmd_pull() { | |
417 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
418 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
419 '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \ |
3537 | 420 ':source:_hg_remote' |
421 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
422 |
3537 | 423 _hg_cmd_push() { |
424 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
425 '(--force -f)'{-f,--force}'[force push]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
426 '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]' \ |
3537 | 427 ':destination:_hg_remote' |
428 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
429 |
3537 | 430 _hg_cmd_remove() { |
431 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
432 '(--after -A)'{-A,--after}'[record remove that has already occurred]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
433 '(--force -f)'{-f,--force}'[remove file even if modified]' \ |
3537 | 434 '*:file:_files -W $(_hg_cmd root)' |
435 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
436 |
3537 | 437 _hg_cmd_rename() { |
438 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
439 '(--after -A)'{-A,--after}'[record a rename that has already occurred]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
440 '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ |
3537 | 441 '*:file:_files -W $(_hg_cmd root)' |
442 } | |
1362 | 443 |
3537 | 444 _hg_cmd_revert() { |
445 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
446 '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
447 '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_tags' \ |
3537 | 448 '--no-backup[do not save backup copies of files]' \ |
449 '*:file:_files -W $(_hg_cmd root)' | |
450 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
451 |
3537 | 452 _hg_cmd_serve() { |
453 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
454 '(--accesslog -A)'{-A+,--accesslog}'[name of access log file]:log file:_files' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
455 '(--errorlog -E)'{-E+,--errorlog}'[name of error log file]:log file:_files' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
456 '(--daemon -d)'{-d,--daemon}'[run server in background]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
457 '(--port -p)'{-p+,--port}'[listen port]:listen port:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
458 '(--address -a)'{-a+,--address}'[interface address]:interface address:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
459 '(--name -n)'{-n+,--name}'[name to show in web pages]:repository name:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
460 '(--templates -t)'{-t,--templates}'[web template directory]:template dir:_files -/' \ |
3537 | 461 '--style[web template style]:style' \ |
462 '--stdio[for remote clients]' \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
463 '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]' |
3537 | 464 } |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
465 |
3537 | 466 _hg_cmd_status() { |
467 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
468 '(--all -A)'{-A,--all}'[show status of all files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
469 '(--modified -m)'{-m,--modified}'[show only modified files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
470 '(--added -a)'{-a,--added}'[show only added files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
471 '(--removed -r)'{-r,--removed}'[show only removed files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
472 '(--deleted -d)'{-d,--deleted}'[show only deleted (but tracked) files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
473 '(--clean -c)'{-c,--clean}'[show only files without changes]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
474 '(--unknown -u)'{-u,--unknown}'[show only unknown files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
475 '(--ignored -i)'{-i,--ignored}'[show ignored files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
476 '(--no-status -n)'{-n,--no-status}'[hide status prefix]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
477 '(--copies -C)'{-C,--copies}'[show source of copied files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
478 '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ |
3537 | 479 '--rev[show difference from revision]:revision:_hg_tags' \ |
480 '*:files:_files' | |
481 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
482 |
3537 | 483 _hg_cmd_tag() { |
484 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
485 '(--local -l)'{-l,--local}'[make the tag local]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
486 '(--message -m)'{-m+,--message}'[message for tag commit log entry]:message:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
487 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
488 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
489 '(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_tags' \ |
3537 | 490 ':tag name:' |
491 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
492 |
3537 | 493 _hg_cmd_tip() { |
494 _arguments -s -w : $_hg_global_opts $_hg_style_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
495 '(--patch -p)'{-p,--patch}'[show patch]' |
3537 | 496 } |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
497 |
3537 | 498 _hg_cmd_unbundle() { |
499 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
500 '(--update -u)'{-u,--update}'[update to new tip if changesets were unbundled]' \ |
3537 | 501 ':files:_files' |
502 } | |
1362 | 503 |
3537 | 504 _hg_cmd_update() { |
505 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
506 '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
507 '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \ |
3537 | 508 ':revision:_hg_tags' |
509 } | |
1362 | 510 |
3537 | 511 # HGK |
512 _hg_cmd_view() { | |
513 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
514 '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ |
3537 | 515 ':revision range:_hg_tags' |
516 } | |
1362 | 517 |
3537 | 518 # MQ |
519 _hg_cmd_qdelete() { | |
520 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
521 '(--keep -k)'{-k,--keep}'[keep patch file]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
522 '*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_qapplied' \ |
3537 | 523 '*:patch:_hg_qunapplied' |
524 } | |
1362 | 525 |
3537 | 526 _hg_cmd_qheader() { |
527 _arguments -s -w : $_hg_global_opts \ | |
528 ':patch:_hg_qseries' | |
529 } | |
1362 | 530 |
3537 | 531 _hg_cmd_qnew() { |
532 _arguments -s -w : $_hg_global_opts $_hg_commit_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
533 '(--force -f)'{-f,--force}'[import uncommitted changes into patch]' \ |
3537 | 534 ':patch:' |
535 } | |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
536 |
3537 | 537 _hg_cmd_qpop() { |
538 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
539 '(--all -a :)'{-a,--all}'[pop all patches]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
540 '(--name -n)'{-n+,--name}'[queue name to pop]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
541 '(--force -f)'{-f,--force}'[forget any local changes]' \ |
3537 | 542 ':patch:_hg_qapplied' |
543 } | |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
544 |
3537 | 545 _hg_cmd_qpush() { |
546 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
547 '(--all -a :)'{-a,--all}'[apply all patches]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
548 '(--list -l)'{-l,--list}'[list patch name in commit text]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
549 '(--merge -m)'{-m+,--merge}'[merge from another queue]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
550 '(--name -n)'{-n+,--name}'[merge queue name]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
551 '(--force -f)'{-f,--force}'[apply if the patch has rejects]' \ |
3537 | 552 ':patch:_hg_qunapplied' |
553 } | |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
554 |
3537 | 555 _hg_cmd_qrefresh() { |
556 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_commit_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
557 '(--git -g)'{-g,--git}'[use git extended diff format]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
558 '(--short -s)'{-s,--short}'[short refresh]' \ |
3537 | 559 '*:files:_files -W $(_hg_cmd root)' |
560 } | |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
561 |
3537 | 562 _hg_cmd_strip() { |
563 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
564 '(--force -f)'{-f,--force}'[force multi-head removal]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
565 '(--backup -b)'{-b,--backup}'[bundle unrelated changesets]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
566 '(--nobackup -n)'{-n,--nobackup}'[no backups]' \ |
3537 | 567 ':revision:_hg_tags' |
568 } | |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
569 |
3537 | 570 _hg "$@" |