# HG changeset patch # User Nikolaj Sjujskij # Date 2012-08-16 15:03:01 # Node ID dbff625679a12b21ede24d143c0aa9e0842853cc # Parent b290d3b1c1b865087ca3aa3e3d1263661606ce06 zsh completion: add subrepos options for all supporting commands diff --git a/contrib/zsh_completion b/contrib/zsh_completion --- a/contrib/zsh_completion +++ b/contrib/zsh_completion @@ -455,12 +455,15 @@ typeset -A _hg_cmd_globals '(--branch -b)'{-b+,--branch}'[specify branch(es)]:branch:_hg_branches' ) +_hg_subrepos_opts=( + '(--subrepos -S)'{-S,--subrepos}'[recurse into subrepositories]') + _hg_cmd() { _call_program hg HGPLAIN=1 hg "$_hg_cmd_globals[@]" "$@" 2> /dev/null } _hg_cmd_add() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ + _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts $_hg_subrepos_opts \ '*:unknown files:_hg_unknown' } @@ -483,7 +486,7 @@ typeset -A _hg_cmd_globals } _hg_cmd_archive() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \ '--no-decode[do not pass files through decoders]' \ '(--prefix -p)'{-p+,--prefix}'[directory prefix for files in archive]:' \ '(--rev -r)'{-r+,--rev}'[revision to distribute]:revision:_hg_labels' \ @@ -557,7 +560,7 @@ typeset -A _hg_cmd_globals } _hg_cmd_commit() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \ '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \ '(--message -m)'{-m+,--message}'[use as commit message]:text:' \ '(--logfile -l)'{-l+,--logfile}'[read commit message from ]:log file:_files -g \*.txt' \ @@ -576,8 +579,8 @@ typeset -A _hg_cmd_globals _hg_cmd_diff() { typeset -A opt_args - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - $_hg_diff_opts $_hg_ignore_space_opts \ + _arguments -s -w : $_hg_global_opts $_hg_diff_opts $_hg_ignore_space_opts \ + $_hg_pat_opts $_hg_subrepos_opts \ '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \ '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \ '*:file:->diff_files' @@ -657,6 +660,7 @@ typeset -A _hg_cmd_globals _hg_cmd_incoming() { _arguments -s -w : $_hg_log_opts $_hg_branch_bmark_opts $_hg_remote_opts \ + $_hg_subrepos_opts \ '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:_hg_tags' \ '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ @@ -706,6 +710,7 @@ typeset -A _hg_cmd_globals _hg_cmd_outgoing() { _arguments -s -w : $_hg_log_opts $_hg_branch_bmark_opts $_hg_remote_opts \ + $_hg_subrepos_opts \ '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]' \ '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ @@ -828,7 +833,7 @@ typeset -A _hg_cmd_globals } _hg_cmd_status() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \ '(--all -A)'{-A,--all}'[show status of all files]' \ '(--modified -m)'{-m,--modified}'[show only modified files]' \ '(--added -a)'{-a,--added}'[show only added files]' \