Mercurial > hg > mercurial-crew-with-dirclash
annotate contrib/zsh_completion @ 3522:fb031f47890f
Remove forget command, deprecated pre-0.9
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 25 Oct 2006 17:47:53 -0500 |
parents | 776c317566b6 |
children | 060aefba4459 |
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 | |
8 # | |
9 # This is free software; you can redistribute it and/or modify it under | |
10 # the terms of the GNU General Public License as published by the Free | |
11 # Software Foundation; either version 2 of the License, or (at your | |
12 # option) any later version. | |
13 # | |
14 | |
15 local curcontext="$curcontext" state line | |
16 typeset -A opt_args | |
3492
776c317566b6
zsh: cache hg help output
Brendan Cully <brendan@kublai.com>
parents:
3491
diff
changeset
|
17 local repos newFiles addedFiles includeExclude commitMessage |
3491
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
18 local ridx _hgroot |
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
19 |
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
20 # FIXME: why isn't opt_args available? |
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
21 [[ -d .hg ]] && _hgroot="$PWD" |
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
22 ridx=$words[(i)-R] |
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
23 (( $ridx < $#words )) && _hgroot="${words[$ridx+1]}" |
3482
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
24 |
3491
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
25 # hg dispatch (borrowed from _cvs) |
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
26 (( $+functions[_hg_cmd] )) || |
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
27 _hg_cmd () { |
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
28 _call_program hg hg -R "$_hgroot" "$@" |
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
29 } |
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
30 |
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
31 (( $+functions[_hg_state] )) || |
3487
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
32 _hg_state () { |
3482
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
33 case "$state" in |
3487
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
34 (tags) |
3491
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
35 compadd $(_hg_cmd tags 2> /dev/null | |
3487
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
36 sed -e 's/[0-9]*:[a-f0-9]*$//; s/ *$//') |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
37 ;; |
3482
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
38 (qapplied) |
3491
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
39 compadd $(_hg_cmd qapplied) |
3482
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
40 ;; |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
41 (qunapplied) |
3491
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
42 compadd $(_hg_cmd qunapplied) |
3482
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
43 ;; |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
44 esac |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
45 } |
1362 | 46 |
3492
776c317566b6
zsh: cache hg help output
Brendan Cully <brendan@kublai.com>
parents:
3491
diff
changeset
|
47 (( $+_hg_commands )) || |
776c317566b6
zsh: cache hg help output
Brendan Cully <brendan@kublai.com>
parents:
3491
diff
changeset
|
48 _hg_commands=($(hg -v help | sed -e '1,/^list of commands:/d' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
49 -e '/^global options:/,$d' -e '/^ [^ ]/!d; s/[,:].*//g;')) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
50 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
51 # A lot of commands have these arguments |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
52 includeExclude=( |
3491
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
53 '*-I-[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/' |
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
54 '*--include-[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/' |
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
55 '*-X-[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/' |
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
56 '*--exclude-[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/') |
1362 | 57 |
3489
0e80552e1275
zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents:
3488
diff
changeset
|
58 styleOpts=( |
0e80552e1275
zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents:
3488
diff
changeset
|
59 '--style[display using template map file]:' |
0e80552e1275
zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents:
3488
diff
changeset
|
60 '--template[display with template]:') |
0e80552e1275
zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents:
3488
diff
changeset
|
61 |
3482
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
62 commitMessage=( |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
63 '(-m --message -l --logfile --edit)-e[edit commit message]' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
64 '(-m --message -l --logfile -e)--edit[edit commit message]' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
65 '(-e --edit -l --logfile --message)-m[use <text> as commit message]:message:' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
66 '(-e --edit -l --logfile -m)--message[use <text> as commit message]:message:' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
67 '(-e --edit -m --message --logfile)-l[read the commit message from <file>]:log file:_files' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
68 '(-e --edit -m --message -l)--logfile[read the commit message from <file>]:log file:_files') |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
69 |
1362 | 70 if [[ $service == "hg" ]]; then |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
71 _arguments -C -A "-*" \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
72 '(--repository)-R[repository root directory]:root:_files -/' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
73 '(-R)--repository[repository root directory]:root:_files -/' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
74 '--cwd[change working directory]:new working directory:_files -/' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
75 '(--noninteractive)-y[do not prompt, assume yes for any required answers]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
76 '(-y)--noninteractive[do not prompt, assume yes for any required answers]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
77 '(--verbose)-v[enable additional output]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
78 '(-v)--verbose[enable additional output]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
79 '(--quiet)-q[suppress output]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
80 '(-q)--quiet[suppress output]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
81 '(--help)-h[display help and exit]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
82 '(-h)--help[display help and exit]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
83 '--debug[debug mode]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
84 '--debugger[start debugger]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
85 '--traceback[print traceback on exception]' \ |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
86 '--time[time how long the command takes]' \ |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
87 '--profile[profile]' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
88 '--version[output version information and exit]' \ |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
89 '*::command:->subcmd' && return 0 |
1362 | 90 |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
91 if (( CURRENT == 1 )); then |
3492
776c317566b6
zsh: cache hg help output
Brendan Cully <brendan@kublai.com>
parents:
3491
diff
changeset
|
92 _wanted commands expl 'hg command' compadd -a _hg_commands |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
93 return |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
94 fi |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
95 service="$words[1]" |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
96 curcontext="${curcontext%:*}=$service:" |
1362 | 97 fi |
98 | |
99 case $service in | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
100 (add) |
3491
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
101 newFiles=(${(ps:\0:)"$(_hg_cmd status -0un .)"}) |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
102 _arguments $includeExclude \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
103 '*:file:->unknown' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
104 _wanted files expl 'unknown files' compadd -a newFiles |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
105 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
106 |
1362 | 107 (addremove) |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
108 _arguments $includeExclude \ |
1362 | 109 '*:directories:_files -/' # assume they want to add/remove a dir |
110 ;; | |
111 | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
112 (forget) |
3491
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
113 addedFiles=(${(ps:\0:)"$(_hg_cmd status -0an .)"}) |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
114 _arguments $includeExclude \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
115 '*:file:->added' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
116 _wanted files expl 'newly added files' compadd -a addedFiles |
1362 | 117 ;; |
118 | |
119 (remove|rm) | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
120 _arguments $includeExclude \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
121 '*:file:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
122 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
123 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
124 (copy|cp) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
125 _arguments $includeExclude \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
126 '(--after)-A[record a copy that has already occurred]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
127 '(-A)--after[record a copy that has already occurred]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
128 '(--force)-f[forcibly copy over an existing managed file]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
129 '(-f)--force[forcibly copy over an existing managed file]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
130 '(--parents)-p[append source path to dest]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
131 '(-p)--parents[append source path to dest]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
132 '*:files:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
133 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
134 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
135 (rename|mv) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
136 if (( CURRENT == 2 )); then |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
137 _arguments $includeExclude \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
138 '(--after)-A[record a rename that has already occurred]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
139 '(-A)--after[record a rename that has already occurred]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
140 '(--force)-f[replace destination if it exists]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
141 '(-F)--force[replace destination if it exists]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
142 '(--parents)-p[append source path to dest]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
143 '(-p)--parents[append source path to dest]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
144 '*:files:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
145 else |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
146 _arguments '*:destination:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
147 fi |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
148 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
149 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
150 (diff) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
151 _arguments $includeExclude \ |
3487
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
152 '*-r[revision]:revision:->tags' \ |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
153 '*--rev[revision]:revision:->tags' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
154 '(--text)-a[treat all files as text]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
155 '(-a)--text[treat all files as text]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
156 '*:file:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
157 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
158 |
1544
b3184bea3eb3
added st as alias for status in zsh_completition
Michael Gebetsroither <michael.geb@gmx.at>
parents:
1486
diff
changeset
|
159 (status|st) |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
160 _arguments $includeExclude \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
161 '(--no-status)-n[hide status prefix]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
162 '(-n)--no-status[hide status prefix]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
163 '(--print0)-0[end filenames with NUL, for use with xargs]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
164 '(-0)--print0[end filenames with NUL, for use with xargs]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
165 '(--modified)-m[show only modified files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
166 '(-m)--modified[show only modified files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
167 '(--added)-a[show only added files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
168 '(-a)--added[show only added files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
169 '(--removed)-r[show only removed files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
170 '(-r)--removed[show only removed files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
171 '(--unknown)-u[show only unknown files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
172 '(-u)--unknown[show only unknown files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
173 '*:search pattern, then files:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
174 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
175 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
176 (revert) |
3491
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
177 addedFiles=(${(ps:\0:)"$(_hg_cmd status -0amrn .)"}) |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
178 _arguments \ |
3487
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
179 '(--rev)-r[revision to revert to]:revision:->tags' \ |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
180 '(-r)--rev[revision to revert to]:revision:->tags' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
181 '(--nonrecursive)-n[do not recurse into subdirectories]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
182 '(-n)--nonrecursive[do not recurse into subdirectories]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
183 '*:file:->modified' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
184 _wanted files expl 'mofified files' compadd -a addedFiles |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
185 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
186 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
187 (commit|ci) |
3491
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
188 addedFiles=(${(ps:\0:)"$(_hg_cmd status -0amrn .)"}) |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
189 _arguments $includeExclude \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
190 '(--addremove)-A[run addremove during commit]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
191 '(-A)--addremove[run addremove during commit]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
192 '(--message)-m[use <txt> as commit message]:string:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
193 '(-m)--message[use <txt> as commit message]:string:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
194 '(--logfile)-l[read commit message from <file>]:.log file:_file -g \*.txt' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
195 '(-l)--logfile[read commit message from <file>]:.log file:_file -g \*.txt' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
196 '(--date)-d[record datecode as commit date]:date code:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
197 '(-d)--date[record datecode as commit date]:date code:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
198 '(--user)-u[record user as commiter]:user:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
199 '(-u)--user[record user as commiter]:user:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
200 '*:file:->modified' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
201 _wanted files expl 'mofified files' compadd -a addedFiles |
1362 | 202 ;; |
203 | |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
204 (cat) |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
205 _arguments $includeExclude \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
206 '(--output)-o[print output to file with formatted name]:filespec:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
207 '(-o)--output[print output to file with formatted name]:filespec:' \ |
3487
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
208 '(--rev)-r[revision]:revision:->tags' \ |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
209 '(-r)--rev[revision]:revision:->tags' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
210 '*:file:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
211 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
212 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
213 (annotate) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
214 _arguments $includeExclude \ |
3487
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
215 '(--rev)-r[annotate the specified revision]:revision:->tags' \ |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
216 '(-r)--rev[annotate the specified revision]:revision:->tags' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
217 '(--text)-a[treat all files as text]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
218 '(-a)--text[treat all files as text]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
219 '(--user)-u[list the author]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
220 '(-u)--user[list the author]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
221 '(--changeset)-c[list the changeset]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
222 '(-c)--changeset[list the changeset]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
223 '(--number)-n[list the revision number (default)]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
224 '(-n)--number[list the revision number (default)]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
225 '*:files:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
226 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
227 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
228 (grep) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
229 _arguments $includeExclude \ |
3487
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
230 '*-r[search in given revision range]:revision:->tags' \ |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
231 '*--rev[search in given revision range]:revision:->tags' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
232 '--all[print all revisions with matches]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
233 '(-print0)-0[end filenames with NUL, for use with xargs]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
234 '(-0)--print0[end filenames with NUL, for use with xargs]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
235 '(--ignore-case)-i[ignore case when matching]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
236 '(-i)--ignore-case[ignore case when matching]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
237 '(--files-with-matches)-l[print names of files and revs that match]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
238 '(-l)--files-with-matches[print names of files and revs that match]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
239 '(--line-number)-n[print matching line numbers]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
240 '(-n)--line-number[print matching line numbers]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
241 '(--user)-u[print user who committed change]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
242 '(-u)--user[print user who committed change]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
243 '*:search pattern:' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
244 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
245 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
246 (locate) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
247 _arguments $includeExclude \ |
3487
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
248 '(--rev)-r[search repository as it stood at revision]:revision:->tags' \ |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
249 '(-r)--rev[search repository as it stood at revision]:revision:->tags' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
250 '(--print0)-0[end filenames with NUL, for use with xargs]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
251 '(-0)--print0[end filenames with NUL, for use with xargs]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
252 '(--fullpath)-f[print complete paths]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
253 '(-f)--fullpath[print complete paths]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
254 '*:search pattern:' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
255 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
256 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
257 (log|history) |
3489
0e80552e1275
zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents:
3488
diff
changeset
|
258 _arguments $includeExclude $styleOpts \ |
3487
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
259 '*-r[show the specified revision or range]:revision:->tags' \ |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
260 '*--rev[show the specified revision or range]:revision:->tags' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
261 '(--no-merges -M --only-merges)-m[show only merge revisions]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
262 '(--no-merges -M -m)--only-merges[show only merge revisions]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
263 '(--only-merges -m --no-merges)-M[do not show merge revisions]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
264 '(--only-merges -m -M)--no-merges[do not show merge revisions]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
265 '(--keyword)-k[search for a keyword]:keyword:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
266 '(-k)--keyword[search for a keyword]:keyword:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
267 '(--branch)-b[show branches]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
268 '(-b)--branch[show branches]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
269 '(--patch)-p[show patch]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
270 '(-p)--patch[show patch]' \ |
1362 | 271 '*:file:_files' |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
272 ;; |
1362 | 273 |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
274 (update|checkout|co) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
275 _arguments \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
276 '(--branch)-b[checkout the head of a specific branch]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
277 '(-b)--branch[checkout the head of a specific branch]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
278 '(-C --clean --merge)-m[allow merging of branches]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
279 '(-C --clean -m)--merge[allow merging of branches]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
280 '(-m --merge --clean)-C[overwrite locally modified files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
281 '(-m --merge -C)--clean[overwrite locally modified files]' \ |
3487
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
282 '*:revision or tag:->tags' |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
283 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
284 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
285 (tag) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
286 _arguments \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
287 '(--local)-l[make the tag local]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
288 '(-l)--local[make the tag local]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
289 '(--message)-m[message for tag commit log entry]:string:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
290 '(-m)--message[message for tag commit log entry]:string:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
291 '(--date)-d[record datecode as commit date]:date code:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
292 '(-d)--date[record datecode as commit date]:date code:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
293 '(--user)-u[record user as commiter]:user:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
294 '(-u)--user[record user as commiter]:user:' \ |
3487
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
295 '*:name, then revision:->tags' |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
296 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
297 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
298 (clone) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
299 if (( CURRENT == 2 )); then |
3491
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
300 repos=( $(_hg_cmd paths | sed -e 's/^.*= //') ) |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
301 _arguments \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
302 '(--no-update)-U[do not update the new working directory]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
303 '(-U)--no-update[do not update the new working directory]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
304 '(--ssh)-e[specify ssh command to use]:string:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
305 '(-e)--ssh[specify ssh command to use]:string:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
306 '--pull[use pull protocol to copy metadata]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
307 '--remotecmd[specify hg command to run on the remote side]:remote hg:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
308 '*:local repo:_files -/' |
1486
d7809d6e9db2
zsh: allow 'hg clone' to complete paths listed in ~/.hgrc
Steve Borho <steve@borho.org>
parents:
1484
diff
changeset
|
309 _wanted source expl 'source repository' compadd -a repos |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
310 elif (( CURRENT == 3 )); then |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
311 _arguments '*:dest repo:_files -/' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
312 fi |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
313 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
314 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
315 (rawcommit) |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
316 _arguments \ |
3487
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
317 '(--parent)-p[parent revision]:revision:->tags' \ |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
318 '(-p)--parent[parent revision]:revision:->tags' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
319 '(--date)-d[record datecode as commit date]:date code:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
320 '(-d)--date[record datecode as commit date]:date code:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
321 '(--user)-u[record user as commiter]:user:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
322 '(-u)--user[record user as commiter]:user:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
323 '(--message)-m[use <txt> as commit message]:string:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
324 '(-m)--message[use <txt> as commit message]:string:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
325 '(--logfile)-l[read commit message from <file>]:.log file:_file -g \*.txt' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
326 '(-l)--logfile[read commit message from <file>]:.log file:_file -g \*.txt' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
327 '(--files)-F[file list]:file list:_files' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
328 '(-F)--files[file list]:file list:_files' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
329 '*:files to commit:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
330 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
331 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
332 (bundle) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
333 if (( CURRENT == 2 )); then |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
334 _arguments '*:changegroup file:_files -g \*.hg' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
335 elif (( CURRENT == 3 )); then |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
336 _arguments '*:other repo:_files -/' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
337 fi |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
338 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
339 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
340 (unbundle) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
341 _arguments '*:changegroup .hg file:_files -g \*.hg' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
342 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
343 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
344 (incoming) |
3489
0e80552e1275
zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents:
3488
diff
changeset
|
345 _arguments $styleOpts \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
346 '(--patch)-p[show patch]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
347 '(-p)--patch[show patch]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
348 '(--no-merges)-M[do not show merge revisions]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
349 '(-M)--no-merges[do not show merge revisions]' \ |
1442
d32dbf86b88d
zsh completion: Added '--newest-first' to incoming, outgoing
Steve Borho <steve@borho.org>
parents:
1438
diff
changeset
|
350 '(--newest-first)-n[show newest record first]' \ |
d32dbf86b88d
zsh completion: Added '--newest-first' to incoming, outgoing
Steve Borho <steve@borho.org>
parents:
1438
diff
changeset
|
351 '(-n)--newest-first[show newest record first]' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
352 '*:mercurial repository:_files -/' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
353 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
354 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
355 (import|patch) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
356 _arguments \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
357 '(--strip)-p[directory strip option for patch (default: 1)]:count:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
358 '(-p)--strip[directory strip option for patch (default: 1)]:count:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
359 '(--force)-f[skip check for outstanding uncommitted changes]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
360 '(-f)--force[skip check for outstanding uncommitted changes]' \ |
3491
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
361 '(--base)-b[base directory to read patches from]:file:_files -W $(_hg_cmd root) -/' \ |
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
362 '(-b)--base[base directory to read patches from]:file:_files -W $(_hg_cmd root) -/' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
363 '*:patch file:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
364 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
365 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
366 (pull) |
3491
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
367 repos=( $(_hg_cmd paths | sed -e 's/^.*= //') ) |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
368 _arguments \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
369 '(--update)-u[update working directory to tip after pull]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
370 '(-u)--update[update working directory to tip after pull]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
371 '(--ssh)-e[specify ssh command to use]:ssh command:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
372 '(-e)--ssh[specify ssh command to use]:ssh command:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
373 '--remotecmd[specify hg command to run on the remote side]:remote hg:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
374 '*:local repo:_files -/' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
375 _wanted source expl 'source repository' compadd -a repos |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
376 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
377 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
378 (outgoing) |
3489
0e80552e1275
zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents:
3488
diff
changeset
|
379 _arguments $styleOpts \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
380 '(--patch)-p[show patch]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
381 '(-p)--patch[show patch]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
382 '(--no-merges)-M[do not show merge revisions]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
383 '(-M)--no-merges[do not show merge revisions]' \ |
1442
d32dbf86b88d
zsh completion: Added '--newest-first' to incoming, outgoing
Steve Borho <steve@borho.org>
parents:
1438
diff
changeset
|
384 '(--newest-first)-n[show newest record first]' \ |
d32dbf86b88d
zsh completion: Added '--newest-first' to incoming, outgoing
Steve Borho <steve@borho.org>
parents:
1438
diff
changeset
|
385 '(-n)--newest-first[show newest record first]' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
386 '*:local repo:_files -/' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
387 _wanted source expl 'source repository' compadd -a repos |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
388 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
389 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
390 (export) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
391 _arguments \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
392 '(--outout)-o[print output to file with formatted name]:filespec:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
393 '(-o)--output[print output to file with formatted name]:filespec:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
394 '(--text)-a[treat all files as text]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
395 '(-a)--text[treat all files as text]' \ |
1362 | 396 '*:revision:->revs' |
397 _wanted revs expl 'revision or tag' compadd -a tags | |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
398 ;; |
1362 | 399 |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
400 (push) |
3491
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3490
diff
changeset
|
401 repos=( $(_hg_cmd paths | sed -e 's/^.*= //') ) |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
402 _arguments \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
403 '(--force)-f[force push]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
404 '(-f)--force[force push]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
405 '(--ssh)-e[specify ssh command to use]:ssh command:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
406 '(-e)--ssh[specify ssh command to use]:ssh command:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
407 '--remotecmd[specify hg command to run on the remote side]:remote hg:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
408 '*:local repo:_files -/' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
409 _wanted source expl 'source repository' compadd -a repos |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
410 ;; |
1362 | 411 |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
412 (serve) |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
413 _arguments \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
414 '(--accesslog)-A[name of access log file]:log file:_files' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
415 '(-A)--accesslog[name of access log file]:log file:_files' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
416 '(--errorlog)-E[name of error log file]:log file:_files' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
417 '(-E)--errorlog[name of error log file]:log file:_files' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
418 '(--port)-p[listen port]:listen port:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
419 '(-p)--port[listen port]:listen port:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
420 '(--address)-a[interface address]:interface address:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
421 '(-a)--address[interface address]:interface address:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
422 '(--name)-n[name to show in web pages]:repository name:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
423 '(-n)--name[name to show in web pages]:repository name:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
424 '(--templates)-t[web template directory]:template dir:_files -/' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
425 '(-t)--templates[web template directory]:template dir:_files -/' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
426 '--style[web template style]:style' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
427 '--stdio[for remote clients]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
428 '(--ipv6)-6[use IPv6 in addition to IPv4]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
429 '(-6)--ipv6[use IPv6 in addition to IPv4]' |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
430 ;; |
1362 | 431 |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
432 (help) |
3492
776c317566b6
zsh: cache hg help output
Brendan Cully <brendan@kublai.com>
parents:
3491
diff
changeset
|
433 _wanted commands expl 'hg command' compadd -a _hg_commands |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
434 ;; |
1362 | 435 |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
436 (heads) |
3489
0e80552e1275
zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents:
3488
diff
changeset
|
437 _arguments $styleOpts \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
438 '(--branches)-b[find branch info]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
439 '(-b)--branches[find branch info]' |
1362 | 440 ;; |
441 | |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
442 (paths) |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
443 _arguments '*:symbolic name:(default default-push)' |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
444 ;; |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
445 |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
446 (init) |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
447 _arguments '*:new repo directory:_files -/' |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
448 ;; |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
449 |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
450 (manifest) |
3487
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
451 _arguments '*:revision:->tags' |
1362 | 452 ;; |
453 | |
3488 | 454 (par*) |
3489
0e80552e1275
zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents:
3488
diff
changeset
|
455 _arguments $styleOpts \ |
3488 | 456 '(--rev 1)-r[show parents of the specified rev]:revision:->tags' \ |
457 '(-r 1)--rev[show parents of the specified rev]:revision:->tags' \ | |
458 '::revision:->tags' | |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
459 ;; |
1362 | 460 |
3490 | 461 (identify|recover|root|undo|verify|version|ct|tags) |
1362 | 462 # no arguments for these commands |
463 ;; | |
464 | |
3490 | 465 # HGK |
466 (vi*) | |
467 _arguments \ | |
468 '(--limit)-l[limit number of changes displayed]:' \ | |
469 '(-l)--limit[limit number of changes displayed]:' \ | |
470 '::revision range:->tags' | |
471 ;; | |
472 | |
3482
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
473 # MQ commands |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
474 (qdel*|qrm|qrem*) |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
475 _arguments \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
476 {-k,--keep}'[keep patch file]' \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
477 {-r,--rev}'[revision]:applied patch:->qapplied' \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
478 '*:unapplied patches:->qunapplied' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
479 ;; |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
480 |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
481 (qnew) |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
482 _arguments $commitMessage \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
483 {-f,--force}'[import uncommitted changes into patch]' \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
484 ':patch name:' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
485 ;; |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
486 |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
487 (qpo*) |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
488 _arguments \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
489 (1){-a,--all}'[pop all patches]' \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
490 {-f,--force}'[forget any local changes]' \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
491 ':applied patch:->qapplied' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
492 ;; |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
493 |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
494 (qpu*) |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
495 _arguments \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
496 (1){-a,--all}'[apply all patches]' \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
497 {-f,--force}'[apply if the patch has rejects]' \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
498 ':unapplied patch:->qunapplied' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
499 ;; |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
500 (qref*) |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
501 _arguments $commitMessage $includeExclude \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
502 {-g,--git}'[use git extended diff format]' \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
503 {-s,--short}'[short refresh]' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
504 ;; |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
505 |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
506 (*) |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
507 _message "unknown hg command completion: $service" |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
508 ;; |
1362 | 509 esac |
3487
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
510 |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3482
diff
changeset
|
511 _hg_state |