diff options
Diffstat (limited to 'Completion/Base/_arguments')
-rw-r--r-- | Completion/Base/_arguments | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments index 17c4d3203..d2b276cf0 100644 --- a/Completion/Base/_arguments +++ b/Completion/Base/_arguments @@ -7,7 +7,7 @@ setopt localoptions extendedglob local args rest ws cur nth def nm expl descr action opt arg tmp local single uns ret=1 soptseq soptseq1 sopts prefix line -local beg optbeg argbeg nargbeg inopt fromrest +local beg optbeg argbeg nargbeg inopt inrest fromrest # Associative arrays used to collect information about the options. @@ -500,7 +500,10 @@ while [[ cur -gt 0 ]]; do line=( "$line[@]" "$ws[1]" ) [[ -n "$inopt" ]] && nargbeg=$(( beg - 1 )) inopt='' - [[ -z "$args[nth]" && "$rest" = \*::* ]] && break + if [[ -z "$args[nth]" && "$rest" = \*::* ]]; then + inrest=yes + break + fi (( nth++ )) fi fi @@ -537,7 +540,7 @@ if [[ -z "$def" || "$def" = :* ]]; then optbeg="$nargbeg" argbeg="$nargbeg" fromrest=yes - [[ "$def" = \*::* ]] && opt='' + [[ -n "$inrest" ]] && opt='' fi fi |