about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2001-05-29 14:21:25 +0000
committerClint Adams <clint@users.sourceforge.net>2001-05-29 14:21:25 +0000
commit99ed055497948dc7a00fabab7d1ea155f83f3111 (patch)
tree641a4f768d4eafe0fbac576fb2aafa9ff6a895af
parent572bd64e32d1ee45de0f9ddb12669863747a35b6 (diff)
downloadzsh-99ed055497948dc7a00fabab7d1ea155f83f3111.tar.gz
zsh-99ed055497948dc7a00fabab7d1ea155f83f3111.tar.xz
zsh-99ed055497948dc7a00fabab7d1ea155f83f3111.zip
14536: multiple --slave loop
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Debian/Command/_update-alternatives21
2 files changed, 20 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 734b2408a..463025603 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2001-05-29  Clint Adams  <clint@zsh.org>
 
+	* 14536: Completion/Debian/Command/_update-alternatives:
+	loop for multiple --slaves thanks to Sven.
+
 	* 14533: Completion/Debian/Command/_dpkg,
 	Completion/Debian/Command/_update-alternatives:
 	use "= ->" for states expecting positional
diff --git a/Completion/Debian/Command/_update-alternatives b/Completion/Debian/Command/_update-alternatives
index 1bf195828..3d85f6118 100644
--- a/Completion/Debian/Command/_update-alternatives
+++ b/Completion/Debian/Command/_update-alternatives
@@ -16,26 +16,39 @@ _arguments -C '--verbose' \
     '--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