Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
_arguments sets are order sensitive?
- X-seq: zsh-workers 36963
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: _arguments sets are order sensitive?
- Date: Sun, 25 Oct 2015 18:36:26 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=ayfTyWZY20JZS/cea9iubzj+Jgk=; b=O6XYRY pxKTg0SAUPT9Rrc3WHc9WEUJz9ckIWBR/tgkpyebBbGcmNZZSORg2vtQAU/LmAQO vHucP/cPPPdqF91WDd5JM025HlQmO8mfqkooBzkMraok1PgYVFom4QHowaF1rMfl SIApvHo6vnHE1xrViWU7qZ+nV3JZPeVJVfIKc=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=ayfTyWZY20JZS/cea9iubzj+Jgk=; b=j1OxG /JU75Zg+gANaB2rLyCVZLsMm2itYvmpNT5jriGahqrvfc3Dpu1IEENn6OZphwBlu QbMwEkFAmoKFAhrrikTGdelkHvrCfE4UqVyWKGwxUaC2RQlwz8K2wXDrA7Eyk6B2 xVhQXMb5bWahUv8PJ/6Tgsy3gvk/BxkyTgwSDw=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Consider this patch, which simply reorders the sets, without any other changes:
[[[
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 16c3225..bf1f81c 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -1757,15 +1757,6 @@ _git-tag () {
fi
_arguments -A '-*' \
- - creation \
- '( -s -u --local-user)-a[create an unsigned, annotated tag]' \
- '(-a -u --local-user)-s[create an signed and annotated tag]' \
- '(-a -s)'{-u,--local-user}'[create a tag, annotated and signed with the given key]: :__git_gpg_secret_keys' \
- '-f[replace existing tag]' \
- '--cleanup=[cleanup message]:mode:((verbatim\:"no cleanup" whitespace\:"remove leading and trailing whitespace" strip\:"remove leading and trailing whitespace and comments"))' \
- $message_opts \
- ': :__git_tags' \
- ':: :__git_commits' \
- deletion \
'-d[delete tags]' \
'*:: :__git_ignore_line_inside_arguments __git_tags' \
@@ -1781,7 +1772,16 @@ _git-tag () {
'::pattern' \
- verification \
'-v[verifies gpg signutare of tags]' \
- '*:: :__git_ignore_line_inside_arguments __git_tags'
+ '*:: :__git_ignore_line_inside_arguments __git_tags' \
+ - creation \
+ '( -s -u --local-user)-a[create an unsigned, annotated tag]' \
+ '(-a -u --local-user)-s[create an signed and annotated tag]' \
+ '(-a -s)'{-u,--local-user}'[create a tag, annotated and signed with the given key]: :__git_gpg_secret_keys' \
+ '-f[replace existing tag]' \
+ '--cleanup=[cleanup message]:mode:((verbatim\:"no cleanup" whitespace\:"remove leading and trailing whitespace" strip\:"remove leading and trailing whitespace and comments"))' \
+ $message_opts \
+ ': :__git_tags' \
+ ':: :__git_commits'
}
(( $+functions[_gitk] )) ||
]]]
The case 'git tag hello <TAB>' is routed to the 'verification' set prior to
the patch and to the 'creation' set after it; that is, it always chooses the
last set.
Shouldn't _arguments be considering all sets eligible at that point? That is,
it should implicitly do «_alternative [creation] [verification] [deletion]»,
instead of choosing only one of them.
Cheers,
Daniel
(I'm not looking into a fix)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author