Mercurial > hg
comparison contrib/zsh_completion @ 1484:840808c57969
zsh completion improvements.
File completers now correctly deal with filenames that contain spaces.
The completers also use 'hg status .' so they'll work correctly when the
default behaviour changes.
author | Steve Borho <steve@borho.org> |
---|---|
date | Mon, 31 Oct 2005 09:58:05 -0800 |
parents | d32dbf86b88d |
children | d7809d6e9db2 |
comparison
equal
deleted
inserted
replaced
1483:a4ba63e04134 | 1484:840808c57969 |
---|---|
56 curcontext="${curcontext%:*}=$service:" | 56 curcontext="${curcontext%:*}=$service:" |
57 fi | 57 fi |
58 | 58 |
59 case $service in | 59 case $service in |
60 (add) | 60 (add) |
61 newFiles=( $(hg status -un) ) | 61 newFiles=(${(ps:\0:)"$(hg status -0un .)"}) |
62 _arguments $includeExclude \ | 62 _arguments $includeExclude \ |
63 '*:file:->unknown' | 63 '*:file:->unknown' |
64 _wanted files expl 'unknown files' compadd -a newFiles | 64 _wanted files expl 'unknown files' compadd -a newFiles |
65 ;; | 65 ;; |
66 | 66 |
68 _arguments $includeExclude \ | 68 _arguments $includeExclude \ |
69 '*:directories:_files -/' # assume they want to add/remove a dir | 69 '*:directories:_files -/' # assume they want to add/remove a dir |
70 ;; | 70 ;; |
71 | 71 |
72 (forget) | 72 (forget) |
73 addedFiles=( $(hg status -an) ) | 73 addedFiles=(${(ps:\0:)"$(hg status -0an .)"}) |
74 _arguments $includeExclude \ | 74 _arguments $includeExclude \ |
75 '*:file:->added' | 75 '*:file:->added' |
76 _wanted files expl 'newly added files' compadd -a addedFiles | 76 _wanted files expl 'newly added files' compadd -a addedFiles |
77 ;; | 77 ;; |
78 | 78 |
132 '(-u)--unknown[show only unknown files]' \ | 132 '(-u)--unknown[show only unknown files]' \ |
133 '*:search pattern, then files:_files' | 133 '*:search pattern, then files:_files' |
134 ;; | 134 ;; |
135 | 135 |
136 (revert) | 136 (revert) |
137 addedFiles=( $(hg status -mrn) ) # modified, removed | 137 addedFiles=(${(ps:\0:)"$(hg status -0amrn .)"}) |
138 _arguments \ | 138 _arguments \ |
139 '(--rev)-r[revision to revert to]:revision:($tags)' \ | 139 '(--rev)-r[revision to revert to]:revision:($tags)' \ |
140 '(-r)--rev[revision to revert to]:revision:($tags)' \ | 140 '(-r)--rev[revision to revert to]:revision:($tags)' \ |
141 '(--nonrecursive)-n[do not recurse into subdirectories]' \ | 141 '(--nonrecursive)-n[do not recurse into subdirectories]' \ |
142 '(-n)--nonrecursive[do not recurse into subdirectories]' \ | 142 '(-n)--nonrecursive[do not recurse into subdirectories]' \ |
143 '*:file:->modified' | 143 '*:file:->modified' |
144 _wanted files expl 'mofified files' compadd -a addedFiles | 144 _wanted files expl 'mofified files' compadd -a addedFiles |
145 ;; | 145 ;; |
146 | 146 |
147 (commit|ci) | 147 (commit|ci) |
148 addedFiles=( $(hg status -amrn) ) # added, modified, removed | 148 addedFiles=(${(ps:\0:)"$(hg status -0amrn .)"}) |
149 _arguments $includeExclude \ | 149 _arguments $includeExclude \ |
150 '(--addremove)-A[run addremove during commit]' \ | 150 '(--addremove)-A[run addremove during commit]' \ |
151 '(-A)--addremove[run addremove during commit]' \ | 151 '(-A)--addremove[run addremove during commit]' \ |
152 '(--message)-m[use <txt> as commit message]:string:' \ | 152 '(--message)-m[use <txt> as commit message]:string:' \ |
153 '(-m)--message[use <txt> as commit message]:string:' \ | 153 '(-m)--message[use <txt> as commit message]:string:' \ |