about summary refs log tree commit diff
path: root/Completion/Core/_sep_parts
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-10-14 15:05:40 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-10-14 15:05:40 +0000
commit9597b7505ab1cf64c246b4a32e14b0602c36b1b2 (patch)
tree97583fa3e3b2c9bcdc3d1f2dfa2baed17d0924c5 /Completion/Core/_sep_parts
parentc0482994a91094dc8e89bddefdeabf36829e9eea (diff)
downloadzsh-9597b7505ab1cf64c246b4a32e14b0602c36b1b2.tar.gz
zsh-9597b7505ab1cf64c246b4a32e14b0602c36b1b2.tar.xz
zsh-9597b7505ab1cf64c246b4a32e14b0602c36b1b2.zip
manual/8249
Diffstat (limited to 'Completion/Core/_sep_parts')
-rw-r--r--Completion/Core/_sep_parts12
1 files changed, 8 insertions, 4 deletions
diff --git a/Completion/Core/_sep_parts b/Completion/Core/_sep_parts
index 0a8cae28f..c65a944e3 100644
--- a/Completion/Core/_sep_parts
+++ b/Completion/Core/_sep_parts
@@ -18,16 +18,20 @@
 # `-X explanation' options.
 
 local str arr sep test testarr tmparr prefix suffixes matchers autosuffix
-local matchflags opt group expl nm=$compstate[nmatches] opre osuf
+local matchflags opt group expl nm=$compstate[nmatches] opre osuf opts match
 
 # Get the options.
 
 group=()
 expl=()
-while getopts "J:V:X:" opt; do
+opts=()
+while getopts "J:V:X:P:S:r:R:qM:" opt; do
   case "$opt" in
   [JV]) group=("-$opt" "$OPTARG");;
   X)    expl=(-X "$OPTARG");;
+  q)    opts=( "$opts[@]" -q );;
+  M)    match="$OPTARG";;
+  *)    opts=( "$opts[@]" "-$opt" "$OPTARG" );;
   esac
 done
 shift OPTIND-1
@@ -142,14 +146,14 @@ done
 # If we have collected matching specifications, we build an array
 # from it that can be used as arguments to `compadd'.
 
-[[ $#matchers -gt 0 ]] && matchers=(-M "$matchers")
+[[ $#matchers+$#match -gt 0 ]] && matchers=(-M "$matchers $match")
 
 # Add the matches for each of the suffixes.
 
 PREFIX="$pre"
 SUFFIX="$suf"
 for i in "$suffixes[@]"; do
-  compadd -U "$group[@]" "$expl[@]" "$matchers[@]" "$autosuffix[@]" \
+  compadd -U "$group[@]" "$expl[@]" "$matchers[@]" "$autosuffix[@]" "$opts[@]" \
           -i "$IPREFIX" -I "$ISUFFIX" -p "$prefix" -s "$i" - "$testarr[@]"
 done