From 35b2633ad941966f5fca07b625a594a5b68c0fdb Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Mon, 15 Nov 1999 12:01:46 +0000 Subject: manual/8639 --- Completion/Core/_alternative | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'Completion/Core/_alternative') diff --git a/Completion/Core/_alternative b/Completion/Core/_alternative index f13fc9e5a..76a8380bc 100644 --- a/Completion/Core/_alternative +++ b/Completion/Core/_alternative @@ -1,22 +1,23 @@ #autoload local tags def expl descr action mesgs nm="$compstack[nmatches]" subopts +local opt curcontext="$curcontext" + +subopts=() +while getopts 'O:C:' opt; do + case "$opt" in + O) subopts=( "${(@P)OPTARG}" ) ;; + C) curcontext="${curontext}:$OPTARG" ;; + esac +done -if [[ "$1" = -O?* ]]; then - subopts=( "${(@P)1[3,-1]}" ) - shift -elif [[ "$1" = -O ]]; then - subopts=( "${(@P)2}" ) - shift 2 -else - subopts=() -fi +shift OPTIND-1 [[ "$1" = -(|-) ]] && shift mesgs=() -_tags "$1" "${(@)argv[2,-1]%%:*}" +_tags "${(@)argv%%:*}" while _tags; do for def; do -- cgit 1.4.1