summaryrefslogtreecommitdiffstats
path: root/Completion/Base/_arguments
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-13 14:00:34 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-13 14:00:34 +0000
commit4ea731c9d8de75f47013b46cc10675b6db98e724 (patch)
tree9318a1caa64c19a6b7892074904eaef8cc737324 /Completion/Base/_arguments
parentzsh-workers/7801 (diff)
downloadzsh-4ea731c9d8de75f47013b46cc10675b6db98e724.tar
zsh-4ea731c9d8de75f47013b46cc10675b6db98e724.tar.gz
zsh-4ea731c9d8de75f47013b46cc10675b6db98e724.tar.bz2
zsh-4ea731c9d8de75f47013b46cc10675b6db98e724.tar.lz
zsh-4ea731c9d8de75f47013b46cc10675b6db98e724.tar.xz
zsh-4ea731c9d8de75f47013b46cc10675b6db98e724.tar.zst
zsh-4ea731c9d8de75f47013b46cc10675b6db98e724.zip
zsh-workers/7804
Diffstat (limited to 'Completion/Base/_arguments')
-rw-r--r--Completion/Base/_arguments8
1 files changed, 6 insertions, 2 deletions
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