summaryrefslogtreecommitdiffstats
path: root/Completion/Base/_arguments
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-11-23 14:24:39 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-11-23 14:24:39 +0000
commit616d348e392e87d491abe5dab2068704aafb00e5 (patch)
tree0e91bd115f6f9895129a084aa8029b873fff8e98 /Completion/Base/_arguments
parentmanual/8746 (diff)
downloadzsh-616d348e392e87d491abe5dab2068704aafb00e5.tar
zsh-616d348e392e87d491abe5dab2068704aafb00e5.tar.gz
zsh-616d348e392e87d491abe5dab2068704aafb00e5.tar.bz2
zsh-616d348e392e87d491abe5dab2068704aafb00e5.tar.lz
zsh-616d348e392e87d491abe5dab2068704aafb00e5.tar.xz
zsh-616d348e392e87d491abe5dab2068704aafb00e5.tar.zst
zsh-616d348e392e87d491abe5dab2068704aafb00e5.zip
zsh-workers/8749
Diffstat (limited to 'Completion/Base/_arguments')
-rw-r--r--Completion/Base/_arguments22
1 files changed, 18 insertions, 4 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index 0a3ffc021..031ed90cf 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -165,8 +165,9 @@ _style -s options auto-description autod
if comparguments -i "$autod" "$@"; then
local nm="$compstate[nmatches]" action noargs aret expl local
- local next direct odirect equal single match matched ws tmp1 tmp2
+ local next direct odirect equal single match matched ws tmp1 tmp2 tmp3
local opts subc prefix suffix
+ local origpre="$PREFIX" origipre="$IPREFIX"
if comparguments -D descr action; then
comparguments -C subc
@@ -254,11 +255,17 @@ if comparguments -i "$autod" "$@"; then
fi
fi
fi
+
if [[ -z "$matched" ]] && _requested options &&
{ ! _style options prefix-needed ||
- [[ "$PREFIX" = [-+]* ]] } ; then
- comparguments -M match
+ [[ "$origpre" = [-+]* ]] } ; then
+ local prevpre="$PREFIX" previpre="$IPREFIX"
+
+ PREFIX="$origpre"
+ IPREFIX="$origipre"
+ comparguments -M match
+
if comparguments -s single; then
_description expl option
@@ -271,11 +278,13 @@ if comparguments -i "$autod" "$@"; then
compadd "$expl[@]" -QqS= - "${PREFIX}${SUFFIX}"
else
tmp1=( "$next[@]" "$direct[@]" "$odirect[@]" "$equal[@]" )
+ tmp3=( "${(M@)tmp1:#[-+]?[^:]*}" )
tmp1=( "${(M@)tmp1:#[-+]?(|:*)}" )
tmp2=( "${PREFIX}${(@M)^${(@)${(@)tmp1%%:*}#[-+]}:#?}" )
_describe -o option \
- tmp1 tmp2 -Q -S ''
+ tmp1 tmp2 -Q -S '' -- \
+ tmp3 -Q
fi
single=yes
else
@@ -285,11 +294,16 @@ if comparguments -i "$autod" "$@"; then
direct -QS '' -M "$match" -- \
equal -QqS= -M "$match"
fi
+ PREFIX="$prevpre"
+ IPREFIX="$previpre"
fi
done
if [[ -n "$opts" && -z "$aret$matched" &&
nm -eq compstate[nmatches] ]]; then
+ PREFIX="$origpre"
+ IPREFIX="$origipre"
+
prefix="${PREFIX#*\=}"
suffix="$SUFFIX"
PREFIX="${PREFIX%%\=*}"