about summary refs log tree commit diff
path: root/Completion/Debian/Command/_update-alternatives
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-07-31 15:26:13 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-07-31 15:26:13 +0000
commitb84399b9cbb93f199d695d7cb264c44178a8d5e0 (patch)
treeaf329c706dd4104718b02c78e2009f9488ad59e5 /Completion/Debian/Command/_update-alternatives
parent27665b32d6e1f60d6e786baa2478aa396f7e9b98 (diff)
downloadzsh-b84399b9cbb93f199d695d7cb264c44178a8d5e0.tar.gz
zsh-b84399b9cbb93f199d695d7cb264c44178a8d5e0.tar.xz
zsh-b84399b9cbb93f199d695d7cb264c44178a8d5e0.zip
tidy up of many completions (updates, fixes, improvements and plain aesthetics)
Diffstat (limited to 'Completion/Debian/Command/_update-alternatives')
-rw-r--r--Completion/Debian/Command/_update-alternatives103
1 files changed, 51 insertions, 52 deletions
diff --git a/Completion/Debian/Command/_update-alternatives b/Completion/Debian/Command/_update-alternatives
index eaeb300b8..dd1d4fce3 100644
--- a/Completion/Debian/Command/_update-alternatives
+++ b/Completion/Debian/Command/_update-alternatives
@@ -1,60 +1,59 @@
 #compdef update-alternatives
 
-local curcontext="$curcontext" context state line expl ret alterdir
-typeset -A opt_args
+local curcontext="$curcontext" context state line alterdir
 
-if [[ -d /var/lib/dpkg/alternatives ]];then
-    alterdir=/var/lib/dpkg/alternatives
-elif [[ -d /var/lib/rpm/alternatives/ ]];then
-    alterdir=/var/lib/rpm/alternatives
+if [[ -d /var/lib/dpkg/alternatives ]]; then
+  alterdir=/var/lib/dpkg/alternatives
+elif [[ -d /var/lib/rpm/alternatives/ ]]; then
+  alterdir=/var/lib/rpm/alternatives
 fi
 
-_arguments -C '--verbose' \
-           '--quiet' \
-           '--test' \
-           '--help' \
-           '--version' \
-           '--altdir:altdir:_files -/' \
-           '--admindir:admindir:_files -/' \
-    '--install:*::alt:= ->install' \
-    '--remove:*::alt:= ->remove' \
-    '--auto:name:_files -W $alterdir' \
-    '--display:name:_files -W $alterdir' \
-    '--config:name:_files -W $alterdir' && return 0
+_arguments -C \
+  '--verbose' \
+  '--quiet' \
+  '--test' \
+  '--help' \
+  '--version' \
+  '--altdir:altdir:_files -/' \
+  '--admindir:admindir:_files -/' \
+  '--install:*::alt:= ->install' \
+  '--remove:*::alt:= ->remove' \
+  '--auto:name:_files -W $alterdir' \
+  '--display:name:_files -W $alterdir' \
+  '--config:name:_files -W $alterdir' && return
 
 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 $alterdir' \
-                   '3:path:_files' \
-                   '--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 $alterdir' \
-                   '3:path:_files' \
-                   '4:priority:' \
-                   '--slave:*::slave:= ->islave' && return 0
-        [[ -z $state ]] && return 1
-	;;
-
-	remove)
-        _call_function ret _update_alternatives_$state && return ret
-	_arguments \
-                   '1:name:_files -W $alterdir' \
-                   '2:path:_files' && return 0
-        return 1
-	;;
-
-	*)
-	return 1
-	;;
-
-esac
+  case "$state" in
+    islave)
+      _call_function ret _update_alternatives_$state && return ret
+      state=
+      _arguments -C \
+	'1:link:_files' \
+	'2:name:_files -W $alterdir' \
+	'3:path:_files' \
+	'--slave:*::more:= ->islave' && return
+      [[ -z $state ]] && return 1
+    ;;
+
+    install)
+      _call_function ret _update_alternatives_$state && return ret
+      _arguments -C \
+	'1:link:_files' \
+	'2:name:_files -W $alterdir' \
+	'3:path:_files' \
+	'4:priority:' \
+	'--slave:*::slave:= ->islave' && return
+      [[ -z $state ]] && return 1
+    ;;
+
+    remove)
+      _call_function ret _update_alternatives_$state && return ret
+      _arguments \
+	'1:name:_files -W $alterdir' \
+	'2:path:_files'
+      return
+    ;;
+
+    *) return 1 ;;
+  esac
 done