Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: remove commas in completion exclusion lists



Another error that is easy to grep for is the use of a comma in an
_arguments exclusion list. It's an easy mistake to make given a brace
expansion on the same line along with the fact that the only thing it
breaks is the exclusion. This is a patch for some identified cases.
Included is one case where the error is in the brace expansion.

Oliver

diff --git a/Completion/Debian/Command/_dak b/Completion/Debian/Command/_dak
index 086196c4a..8ecfd84b3 100644
--- a/Completion/Debian/Command/_dak
+++ b/Completion/Debian/Command/_dak
@@ -27,7 +27,7 @@ case $cmd in
   '(-G --greaterthan)'{-G,--greaterthan}
   '(-r --regex)'{-r,--regex}
   '(-s --suite)'{-s,--suite=}':suite:_values -s , "suite list" oldstable stable testing unstable experimental'
-  '(-S, --source-and-binary)'{-S,--source-and-binary}
+  '(-S --source-and-binary)'{-S,--source-and-binary}
   '*:package:_deb_packages avail'
         )
     ;;
@@ -75,7 +75,7 @@ case $cmd in
   '(-p --partial)'{-p,--partial}'[do not affect override files]'
   '(-R --rdep-check)'{-R,--rdep-check}'[check reverse dependencies]'
   '(-s --suite)'{-s,--suite=}':suite:_values -s , "suite list" oldstable stable testing unstable experimental'
-  '(-S, --source-only)'{-S,--source-only}'[remove source only]'
+  '(-S --source-only)'{-S,--source-only}'[remove source only]'
   '*:package:_deb_packages avail'
     )
     ;;
@@ -155,10 +155,10 @@ case $cmd in
   '(-c --component)'{-c,--component=}':component:(main contrib non-free)'
   '(-s --suite)'{-s,--suite=}':suite:(oldstable stable testing unstable experimental)'
   '(-t --type)'{-t,--type=}':type:(deb dsc udeb)'
-  '(-a, --add)'{-a,--add}'[add overrides]'
-  '(-S, --set)'{-S,--set}'[set overrides]'
-  '(-l, --list)'{-l,--list}'[list overrides]'
-  '(-q, --quiet)'{-q,--quiet}'[be less verbose]'
+  '(-a --add)'{-a,--add}'[add overrides]'
+  '(-S --set)'{-S,--set}'[set overrides]'
+  '(-l --list)'{-l,--list}'[list overrides]'
+  '(-q --quiet)'{-q,--quiet}'[be less verbose]'
         )
     ;;
 
diff --git a/Completion/Debian/Command/_dpkg b/Completion/Debian/Command/_dpkg
index 3477e6116..48ea2db97 100644
--- a/Completion/Debian/Command/_dpkg
+++ b/Completion/Debian/Command/_dpkg
@@ -86,7 +86,7 @@ _dpkg_deb_and_query_only_options=(
 _dpkg_query_actions=(
       '(--status -s)'{--status,-s}'[display package status]:*:packages:->status'
       '(--print-avail -p)'{--print-avail,-p}'[display available details]:packages:_deb_packages avail'
-      '(--listfiles, -L)'{--listfiles,-L}'[list owned files]:*:packages:->listfiles'
+      '(--listfiles -L)'{--listfiles,-L}'[list owned files]:*:packages:->listfiles'
       '(--list -l)'{--list,-l}'[list packages]:*:packages:->list'
       '(--search -S)'{--search,-S}'[search for file owner]:*:pattern:->search'
       '--admindir=[data directory]:directory:_files -/'
diff --git a/Completion/Debian/Command/_madison b/Completion/Debian/Command/_madison
index 445b79a45..dfdf1b438 100644
--- a/Completion/Debian/Command/_madison
+++ b/Completion/Debian/Command/_madison
@@ -9,6 +9,6 @@ _arguments \
   '(-h --help)'{-h,--help} \
   '(-r --regex)'{-r,--regex} \
   '(-s --suite)'{-s,--suite=}':suite:_values -s , "suite list" oldstable stable testing unstable' \
-  '(-S, --source-and-binary)'{-S,--source-and-binary} \
+  '(-S --source-and-binary)'{-S,--source-and-binary} \
   '*:package:_deb_packages avail'
 
diff --git a/Completion/Unix/Command/_aap b/Completion/Unix/Command/_aap
index 089a993c3..38e50f1fc 100644
--- a/Completion/Unix/Command/_aap
+++ b/Completion/Unix/Command/_aap
@@ -20,7 +20,7 @@ _arguments -C -s -S \
   \*{-c,--command=}'[execute a command after reading the recipe]:aap command:' \
   '(-k --continue)'{-k,--continue}'[continue building after an error]' \
   '(-S --stop)'{-S,--stop}'[stop building at first error (default)]' \
-  '(-N,--nofetch-recipe -R --fetch-recipe)'{-R,--fetch-recipe}'[fetch recipe file and child recipes]' \
+  '(-N --nofetch-recipe -R --fetch-recipe)'{-R,--fetch-recipe}'[fetch recipe file and child recipes]' \
   '(-R --fetch-recipe -N --nofetch-recipe)'{-N,--nofetch-recipe}'[do not fetch recipes for "fetch" target]' \
   '(-a --nocache)'{-a,--nocache}"[always download files, don't use the cache]" \
   '(-l --local)'{-l,--local}'[do not recurse into subdirectories]' \
diff --git a/Completion/Unix/Command/_samba b/Completion/Unix/Command/_samba
index 775543794..6c7a64e18 100644
--- a/Completion/Unix/Command/_samba
+++ b/Completion/Unix/Command/_samba
@@ -96,7 +96,7 @@ case $service in
   smbstatus)
     _arguments -s -S $args \
       {-b,--brief}'[brief output]' \
-      '(-v --verbose)'(-v,--verbose)'[be verbose]' \
+      '(-v --verbose)'{-v,--verbose}'[be verbose]' \
       '(-d --debuglevel)'{-d+,--debuglevel=}'[specify debug level]:debug level:(0 1 2 3 4 5 6 7 8 9 10)' \
       '(-u --user)'{-u+,--user=}'[specify user to restrict information to]:user:_users' \
       '(-B --byterange)'{-B,--byterange}'[include byte range locks]' \
diff --git a/Completion/Unix/Command/_setfacl b/Completion/Unix/Command/_setfacl
index 5c573a581..14be49d95 100644
--- a/Completion/Unix/Command/_setfacl
+++ b/Completion/Unix/Command/_setfacl
@@ -3,11 +3,11 @@
 if _pick_variant cygwin=cygwin unix --version; then
 # cygwin 1.5.25
 _arguments -s -S \
-  '(-d, --delete)'{-d,--delete}'[delete one or more specified ACL entries]:ACL entry:' \
-  '(-f, --file)'{-f,--file}'[set ACL entries for FILE to ACL entries read from a ACL_FILE]:ACL file:_files' \
-  '(-m, --modify)'{-m,--modify}'[modify one or more specified ACL entries]:ACL entry:' \
-  '(-r, --replace)'{-r,--replace}'[replace mask entry with maximum permissions needed for the file group class]' \
-  '(-s, --substitute)'{-s,--substitute}'[substitute specified ACL entries for the \[ACL of FILE\]]:ACL entry:' \
+  '(-d --delete)'{-d,--delete}'[delete one or more specified ACL entries]:ACL entry' \
+  '(-f --file)'{-f,--file}'[set ACL entries for FILE to ACL entries read from a ACL_FILE]:ACL file:_files' \
+  '(-m --modify)'{-m,--modify}'[modify one or more specified ACL entries]:ACL entry' \
+  '(-r --replace)'{-r,--replace}'[replace mask entry with maximum permissions needed for the file group class]' \
+  '(-s --substitute)'{-s,--substitute}'[substitute specified ACL entries for the \[ACL of FILE\]]:ACL entry' \
   '(- *)'{-h,--help}'[output usage information and exit]' \
   '(- *)'{-v,--version}'[output version information and exit]' \
   '*: :_files'
diff --git a/Completion/Zsh/Function/_zargs b/Completion/Zsh/Function/_zargs
index f974ab646..94a35e3a5 100644
--- a/Completion/Zsh/Function/_zargs
+++ b/Completion/Zsh/Function/_zargs
@@ -18,17 +18,17 @@ case $numeofs in
     #zargs arguments
     arguments=(
       '(--eof -e)'{--eof=,-e+}'[change the end-of-input-args string from "--" to eof-str]'
-      '(--exit, -x)'{--exit,-x}'[exit if the size (see --max-chars) is exceeded]'
+      '(--exit -x)'{--exit,-x}'[exit if the size (see --max-chars) is exceeded]'
       '--help[print summary and exit]'
-      '(--interactive, -p)'{--interactive,-p}'[prompt before executing each command line]'
-      '(--max-args, -n)'{--max-args=,-n+}'[use at most max-args arguments per command line]'
-      '(--max-chars, -s)'{--max-chars=,-s+}'[use at most max-chars characters per command line]'
-      '(--max-lines, -l)'{--max-lines=,-l+}'[use at most max-lines of the input-args per command line]'
-      '(--max-procs, -P)'{--max-procs=,-P+}'[run up to max-procs command lines in the background at once]'
-      '(--no-run-if-empty, -r)'{--no-run-if-empty,-r}'[do nothing if there are no input arguments before the eof-str]'
-      '(--null, -0)'{--null,-0}'[split each input-arg at null bytes, for xargs compatibility]'
-      '(--replace, -i)'{--replace=,-i}'[substitute replace-str in the initial-args by each initial-arg]'
-      '(--verbose, -t)'{--verbose,-t}'[print each command line to stderr before executing it]'
+      '(--interactive -p)'{--interactive,-p}'[prompt before executing each command line]'
+      '(--max-args -n)'{--max-args=,-n+}'[use at most max-args arguments per command line]'
+      '(--max-chars -s)'{--max-chars=,-s+}'[use at most max-chars characters per command line]'
+      '(--max-lines -l)'{--max-lines=,-l+}'[use at most max-lines of the input-args per command line]'
+      '(--max-procs -P)'{--max-procs=,-P+}'[run up to max-procs command lines in the background at once]'
+      '(--no-run-if-empty -r)'{--no-run-if-empty,-r}'[do nothing if there are no input arguments before the eof-str]'
+      '(--null -0)'{--null,-0}'[split each input-arg at null bytes, for xargs compatibility]'
+      '(--replace -i)'{--replace=,-i}'[substitute replace-str in the initial-args by each initial-arg]'
+      '(--verbose -t)'{--verbose,-t}'[print each command line to stderr before executing it]'
       '--version[print the version number of zargs and exit]'
     )
     _arguments -S -s $arguments[@] && ret=0




Messages sorted by: Reverse Date, Date, Thread, Author