comparison contrib/zsh_completion @ 39377:b4e7e1f09c09

zsh_completion: complete merge tools for -t/--tool Differential Revision: https://phab.mercurial-scm.org/D4362
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 22 Aug 2018 08:20:51 +0800
parents ad1c6bd3c676
children 09f23b4f1be3
comparison
equal deleted inserted replaced
39376:5f8282f368b2 39377:b4e7e1f09c09
279 typeset -a items 279 typeset -a items
280 items=(${${(%f)"$(_call_program hg hg showconfig)"}%%\=*}) 280 items=(${${(%f)"$(_call_program hg hg showconfig)"}%%\=*})
281 (( $#items )) && _describe -t config 'config item' items 281 (( $#items )) && _describe -t config 'config item' items
282 } 282 }
283 283
284 _hg_internal_merge_tools=(
285 \\:dump \\:fail \\:forcedump \\:local \\:merge \\:merge-local \\:merge-other
286 \\:merge3 \\:other \\:prompt \\:tagmerge \\:union
287 )
288
289 _hg_merge_tools() {
290 typeset -a external_tools
291 _describe -t internal_tools 'internal merge tools' _hg_internal_merge_tools
292 external_tools=(${(f)"$(_hg_cmd showconfig merge-tools | cut -d . -f 2)"})
293 (( $#external_tools )) && _describe -t external_tools 'external merge tools' external_tools
294 }
295
284 _hg_addremove() { 296 _hg_addremove() {
285 _alternative 'files:unknown files:_hg_unknown' \ 297 _alternative 'files:unknown files:_hg_unknown' \
286 'files:missing files:_hg_missing' 298 'files:missing files:_hg_missing'
287 } 299 }
288 300
414 $_hg_gitlike_opts 426 $_hg_gitlike_opts
415 '(--text -a)'{-a,--text}'[treat all files as text]' 427 '(--text -a)'{-a,--text}'[treat all files as text]'
416 '--nodates[omit dates from diff headers]') 428 '--nodates[omit dates from diff headers]')
417 429
418 _hg_mergetool_opts=( 430 _hg_mergetool_opts=(
419 '(--tool -t)'{-t+,--tool=}'[specify merge tool]:merge tool' 431 '(--tool -t)'{-t+,--tool=}'[specify merge tool]:merge tool:_hg_merge_tools'
420 ) 432 )
421 433
422 _hg_dryrun_opts=( 434 _hg_dryrun_opts=(
423 '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]') 435 '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]')
424 436