summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2001-05-28 19:06:50 +0000
committerClint Adams <clint@users.sourceforge.net>2001-05-28 19:06:50 +0000
commitaa76e74a05367ad4c0256c540733e2fe908cd7c3 (patch)
tree8186fe89ed5c503cb480528b707464d6cdfe672e /Completion
parent661857b1619f0e1381e4b3337042c3467f7070f6 (diff)
downloadzsh-aa76e74a05367ad4c0256c540733e2fe908cd7c3.tar.gz
zsh-aa76e74a05367ad4c0256c540733e2fe908cd7c3.tar.xz
zsh-aa76e74a05367ad4c0256c540733e2fe908cd7c3.zip
14513: update-alternatives completion
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