about summary refs log tree commit diff
path: root/Completion/Base/Core/_next_label
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Base/Core/_next_label')
-rw-r--r--Completion/Base/Core/_next_label12
1 files changed, 5 insertions, 7 deletions
diff --git a/Completion/Base/Core/_next_label b/Completion/Base/Core/_next_label
index 48845229a..ff9b658a1 100644
--- a/Completion/Base/Core/_next_label
+++ b/Completion/Base/Core/_next_label
@@ -1,21 +1,19 @@
 #autoload
 
-local __gopt=-J __descr __spec
+local __gopt __descr __spec
 
-if [[ "$1" = -([12]|)[VJ] ]]; then
-  __gopt="$1"
-  shift
-fi
+__gopt=()
+zparseopts -D -a __gopt 1 2 V J x
 
 if comptags -A "$1" curtag __spec; then
   _comp_tags="$_comp_tags $__spec "
   if [[ "$curtag" = *[^\\]:* ]]; then
     zformat -f __descr "${curtag#*:}" "d:$3"
-    _description "$__gopt" "${curtag%:*}" "$2" "$__descr"
+    _description "$__gopt[@]" "${curtag%:*}" "$2" "$__descr"
     curtag="${curtag%:*}"
     set -A $2 "${(P@)2}" "${(@)argv[4,-1]}"
   else
-    _description "$__gopt" "$curtag" "$2" "$3"
+    _description "$__gopt[@]" "$curtag" "$2" "$3"
     set -A $2 "${(@)argv[4,-1]}" "${(P@)2}"
   fi