Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Re: PATCH: update-alternatives completion
- X-seq: zsh-workers 14535
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: PATCH: Re: PATCH: update-alternatives completion
- Date: Tue, 29 May 2001 15:08:18 +0200 (MET DST)
- In-reply-to: <20010529083212.A31244@xxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Clint Adams wrote:
> ...
>
> update-alternatives --quiet --install /usr/bin/awk awk /usr/bin/gawk 10 \
> --slave /usr/share/man/man1/awk.1.gz awk.1.gz /usr/share/man/man1/gawk.1.gz \
> --slave /usr/bin/nawk nawk /usr/bin/gawk \
> --slave /usr/share/man/man1/nawk.1.gz nawk.1.gz /usr/share/man/man1/gawk.1.gz
>
> For each --slave, you repeat the <path> <name> <path>.
Two possibilities, then (at least). The large one (simplified):
while true; do
case "$state" in
islave)
state=
_arguments '1:path:(spath)' \
'2:name:(sname)' \
'3:path:(spath2)' \
'--slave:*::more:= ->islave' && return 0
[[ -z $state ]] && return 1
;;
install)
_arguments '1:link:(link)' \
'2:name:(name)' \
'3:path:(path)' \
'--slave:*::more:= ->islave' && return 0
[[ -z $state ]] && return 1
;;
other states)
...
;;
esac
done
Or just (simplified, too):
case "$state" in
other states)
...
;;
install)
_arguments '1:link:(link)' \
'2:name:(name)' \
'3:path:(path)' \
'*--slave:path:(spath):name:(sname):path:(spath2)'
esac
Without a `islave' state. It would allow mixing the arguments of
--install with the --slave options which probably isn't allowed.
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author