summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Debian/Command/.distfiles1
-rw-r--r--Completion/Debian/Command/_update-alternatives41
2 files changed, 42 insertions, 0 deletions
diff --git a/Completion/Debian/Command/.distfiles b/Completion/Debian/Command/.distfiles
index a45d022f7..d4660841e 100644
--- a/Completion/Debian/Command/.distfiles
+++ b/Completion/Debian/Command/.distfiles
@@ -1,4 +1,5 @@
 DISTFILES_SRC='
 .distfiles
 _apt          _bug          _dpkg         _dpkg_source  _dupload
+_update_alternatives
 '
diff --git a/Completion/Debian/Command/_update-alternatives b/Completion/Debian/Command/_update-alternatives
new file mode 100644
index 000000000..2f5c5fe47
--- /dev/null
+++ b/Completion/Debian/Command/_update-alternatives
@@ -0,0 +1,41 @@
+#compdef update-alternatives
+
+local curcontext="$curcontext" context state line expl ret
+typeset -A opt_args
+
+_arguments -C '--verbose' \
+           '--quiet' \
+           '--test' \
+           '--help' \
+           '--version' \
+           '--altdir:altdir:_files -/' \
+           '--admindir:admindir:_files -/' \
+    '--install:*::alt:->install' \
+    '--remove:*::alt:->remove' \
+    '--auto:altname:_files -W /var/lib/dpkg/alternatives' \
+    '--display:altname:_files -W /var/lib/dpkg/alternatives' \
+    '--config:altname:_files -W /var/lib/dpkg/alternatives' && return 0
+
+_call_function ret _update_alternatives_$state && return ret
+case "$state" in
+	islave)
+	_arguments -C '1:link:_files' \
+                   '2:name:_files -W /var/lib/dpkg/alternatives' \
+                   '3:path:_files' \
+                   '--slave:*::slave:->islave'
+	;;
+	install)
+	_arguments -C '1:link:_files' \
+                   '2:name:_files -W /var/lib/dpkg/alternatives' \
+                   '3:path:_files' \
+                   '4:priority:' \
+                   '--slave:*::slave:->islave' \
+	;;
+
+	remove)
+	_arguments \
+                   '1:altname:_files -W /var/lib/dpkg/alternatives' \
+                   '2:path:_files'
+	;;
+
+esac