zsh-workers
 help / color / mirror / code / Atom feed
* _arguments sets are order sensitive?
@ 2015-10-25 18:36 Daniel Shahaf
  0 siblings, 0 replies; only message in thread
From: Daniel Shahaf @ 2015-10-25 18:36 UTC (permalink / raw)
  To: zsh-workers

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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-25 18:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-25 18:36 _arguments sets are order sensitive? Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).