From 567e221218ed1e882a42235b100b1e023b52e1b7 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Thu, 11 May 2000 11:27:39 +0000 Subject: make _argument_sets add the options as defaults when there is nothing else to complete (11324) --- Completion/Base/_argument_sets | 4 ++++ Completion/Base/_arguments | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Completion/Base') 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 -- cgit 1.4.1