From 74ccd8d5a3d9e6f7e14d57f73d58d1319b99e9ca Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Wed, 9 Feb 2000 16:29:22 +0000 Subject: zsh-workers/9635 --- Completion/Core/_multi_parts | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'Completion/Core/_multi_parts') diff --git a/Completion/Core/_multi_parts b/Completion/Core/_multi_parts index e64e2906f..61bd3acaf 100644 --- a/Completion/Core/_multi_parts +++ b/Completion/Core/_multi_parts @@ -13,22 +13,18 @@ typeset -U tmp2 # Get the options. -group=() -expl=() -opts=() -sopts=() -while getopts "J:V:X:P:F:S:r:R:qM:12n" opt; do - case "$opt" in - [JV]) group=("-$opt" "$OPTARG");; - X) expl=(-X "$OPTARG");; - [PF]) opts=( "$opts[@]" "-$opt" "$OPTARG") - sopts=( "$sopts[@]" "-$opt" "$OPTARG");; - [SrR]) sopts=( "$sopts[@]" -P "$OPTARG");; - [q12n]) sopts=( "$sopts[@]" "-$opt");; - M) match="$OPTARG";; - esac -done -shift OPTIND-1 +zparseopts -D \ + J:group V:group X:expl \ + P:opts F:opts \ + S:sopts r:sopts R:sopts qsopts 1sopts 2sopts nsopts \ + M:match + +sopts=( "$sopts[@]" "$opts[@]" ) +if (( $#match )); then + match="${match[1][3,-1]}" +else + match='' +fi # Get the arguments, first the separator, then the array. The array is # stored in `matches'. Further on this array will always contain those -- cgit 1.4.1