# HG changeset patch # User Anton Shestakov # Date 2018-10-17 14:32:50 # Node ID d365e2b7aa2ac8fdedd631a777c90098ffa51696 # Parent 01bdf7294274e1ff3c3e60f77e2c90480c65d741 zsh_completion: add -l/--list flag for hg bookmarks completion Flags in parentheses are mutually exclusive. Logic is taken from commands.py: selactions = [k for k in ['delete', 'rename', 'list'] if opts.get(k)] if len(selactions) > 1: raise error.Abort(_('--%s and --%s are incompatible') % tuple(selactions[:2])) ... if rev and action in {'delete', 'rename', 'list'}: raise error.Abort(_("--rev is incompatible with --%s") % action) if inactive and action in {'delete', 'list'}: raise error.Abort(_("--inactive is incompatible with --%s") % action) Differential Revision: https://phab.mercurial-scm.org/D5142 diff --git a/contrib/zsh_completion b/contrib/zsh_completion --- a/contrib/zsh_completion +++ b/contrib/zsh_completion @@ -532,10 +532,11 @@ typeset -A _hg_cmd_globals _hg_cmd_bookmarks() { _arguments -s -S : $_hg_global_opts \ '(--force -f)'{-f,--force}'[force]' \ - '(--inactive -i)'{-i,--inactive}'[mark a bookmark inactive]' \ - '(--rev -r --delete -d --rename -m)'{-r+,--rev=}'[revision]:revision:_hg_labels' \ - '(--rev -r --delete -d --rename -m)'{-d,--delete}'[delete a given bookmark]' \ - '(--rev -r --delete -d --rename -m)'{-m+,--rename=}'[rename a given bookmark]:bookmark:_hg_bookmarks' \ + '(--inactive -i --delete -d --list -l)'{-i,--inactive}'[mark a bookmark inactive]' \ + '(--rev -r --delete -d --rename -m --list -l)'{-r+,--rev=}'[revision]:revision:_hg_labels' \ + '(--rev -r --delete -d --rename -m --list -l --inactive -i)'{-d,--delete}'[delete a given bookmark]' \ + '(--rev -r --delete -d --rename -m --list -l)'{-m+,--rename=}'[rename a given bookmark]:bookmark:_hg_bookmarks' \ + '(--inactive -i --delete -d --list -l)'{-l,--list}'[list existing bookmarks]' \ ':bookmark:_hg_bookmarks' }