Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Re: PATCH: update-alternatives completion
- X-seq: zsh-workers 14536
- From: Clint Adams <clint@xxxxxxx>
- To: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: PATCH: Re: PATCH: update-alternatives completion
- Date: Tue, 29 May 2001 10:19:31 -0400
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <200105291308.PAA09291@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>; from wischnow@xxxxxxxxxxxxxxxxxxxxxxx on Tue, May 29, 2001 at 03:08:18PM +0200
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20010529083212.A31244@xxxxxxxx> <200105291308.PAA09291@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
> Two possibilities, then (at least). The large one (simplified):
Here goes.
Index: Completion/Debian/Command/_update-alternatives
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Debian/Command/_update-alternatives,v
retrieving revision 1.2
diff -u -r1.2 _update-alternatives
--- Completion/Debian/Command/_update-alternatives 2001/05/29 12:39:31 1.2
+++ Completion/Debian/Command/_update-alternatives 2001/05/29 14:17:16
@@ -16,26 +16,39 @@
'--display:name:_files -W /var/lib/dpkg/alternatives' \
'--config:name:_files -W /var/lib/dpkg/alternatives' && return 0
-_call_function ret _update_alternatives_$state && return ret
+while true; do
case "$state" in
islave)
+ _call_function ret _update_alternatives_$state && return ret
+ state=
_arguments -C '1:link:_files' \
'2:name:_files -W /var/lib/dpkg/alternatives' \
'3:path:_files' \
- '--slave:*::slave:->islave'
+ '--slave:*::more:= ->islave' && return 0
+ [[ -z $state ]] && return 1
;;
+
install)
+ _call_function ret _update_alternatives_$state && return ret
_arguments -C '1:link:_files' \
'2:name:_files -W /var/lib/dpkg/alternatives' \
'3:path:_files' \
'4:priority:' \
- '--slave:*::slave:->islave' \
+ '--slave:*::slave:= ->islave' && return 0
+ [[ -z $state ]] && return 1
;;
remove)
+ _call_function ret _update_alternatives_$state && return ret
_arguments \
'1:name:_files -W /var/lib/dpkg/alternatives' \
- '2:path:_files'
+ '2:path:_files' && return 0
+ return 1
+ ;;
+
+ *)
+ return 1
;;
esac
+done
Messages sorted by:
Reverse Date,
Date,
Thread,
Author