summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Base/_argument_sets4
-rw-r--r--Completion/Base/_arguments5
2 files changed, 7 insertions, 2 deletions
diff --git a/Completion/Base/_argument_sets b/Completion/Base/_argument_sets
index d9c771051..f8a55dad9 100644
--- a/Completion/Base/_argument_sets
+++ b/Completion/Base/_argument_sets
@@ -59,6 +59,10 @@ while true; do
 done
 
 [[ -n "$_ms_opt" ]] &&
+   { ! zstyle -T ":completion:${curcontext}:options" prefix-needed ||
+     [[ "$PREFIX" = [-+]* ||
+     ( -z "$has_args" && ret -ne 300 && nm -eq compstate[nmatches] ) ]] } &&
+  has_args=yes &&
   _describe -o option \
             _ms_soptmid _ms_soptmidadd -Q -S '' -- \
 	    _ms_soptend -Q -- \
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index ed7bd98d7..e12dca47d 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -287,9 +287,10 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then
       done
 
       if [[ -z "$matched$hasopts" ]] && _requested options &&
-          { ! zstyle -T ":completion:${curcontext}:options" prefix-needed ||
+          { [[ -n "$ismulti" ]] ||
+            ! zstyle -T ":completion:${curcontext}:options" prefix-needed ||
             [[ "$origpre" = [-+]* ||
-            ( -z "$aret$mesg" && nm -eq compstate[nmatches] ) ]] } ; then
+               ( -z "$aret$mesg" && nm -eq compstate[nmatches] ) ]] } ; then
 	local prevpre="$PREFIX" previpre="$IPREFIX"
 
 	hasopts=yes