about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-11 11:27:39 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-11 11:27:39 +0000
commit567e221218ed1e882a42235b100b1e023b52e1b7 (patch)
treed07bd95855adec14b8f5c15ad84b0f60fdfb20cc /Completion
parent51511cd7c8e94085033641a8ffe5081f25d024d4 (diff)
downloadzsh-567e221218ed1e882a42235b100b1e023b52e1b7.tar.gz
zsh-567e221218ed1e882a42235b100b1e023b52e1b7.tar.xz
zsh-567e221218ed1e882a42235b100b1e023b52e1b7.zip
make _argument_sets add the options as defaults when there is nothing else to complete (11324)
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