From 4ea731c9d8de75f47013b46cc10675b6db98e724 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Mon, 13 Sep 1999 14:00:34 +0000 Subject: zsh-workers/7804 --- Completion/Base/_arguments | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Completion') diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments index 823d4c3a6..7d5aa9ca9 100644 --- a/Completion/Base/_arguments +++ b/Completion/Base/_arguments @@ -8,7 +8,7 @@ setopt localoptions extendedglob local args rest ws cur nth def nm expl descr action opt arg tmp xor local single uns ret=1 aret soptseq soptseq1 sopts prefix _line odescr local beg optbeg argbeg nargbeg inopt inrest fromrest cmd="$words[1]" -local matched curopt +local matched curopt noargs # Associative arrays used to collect information about the options. @@ -625,6 +625,10 @@ if [[ -z "$def" || "$def" = :* ]]; then fromrest=yes [[ -n "$inrest" ]] && opt='' fi + if [[ -z "$def" ]]; then + _message 'no more arguments' + noargs=yes + fi fi # In any case, we have to complete option names here, but we may @@ -814,7 +818,7 @@ while true; do # Probably add the option names. if [[ -n "$opt" && - ( ( nm -eq compstate[nmatches] && -z "$aret" ) || + ( ( ( nm -eq compstate[nmatches] || -n "$noargs" ) && -z "$aret" ) || -z "$compconfig[option_prefix]" || "$compconfig[option_prefix]" = *\!${cmd}* || "$PREFIX" = [-+]* ) ]]; then -- cgit 1.4.1