From 9597b7505ab1cf64c246b4a32e14b0602c36b1b2 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Thu, 14 Oct 1999 15:05:40 +0000 Subject: manual/8249 --- Completion/Core/_sep_parts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Completion/Core/_sep_parts') 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 -- cgit 1.4.1