about summary refs log tree commit diff
path: root/Completion/Debian/Command/_update-alternatives
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Debian/Command/_update-alternatives')
-rw-r--r--Completion/Debian/Command/_update-alternatives21
1 files changed, 17 insertions, 4 deletions
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