diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2003-08-22 16:30:28 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2003-08-22 16:30:28 +0000 |
commit | 2270746356368eb20676bbfb26c82c2a06e694ec (patch) | |
tree | 90c91d1100d1145c9d7e6b16cd786b94f1f92f3f /Completion/Debian/Command/_update-alternatives | |
parent | 2fe227ff13556508ed844e8996c8c3bc8401a4a3 (diff) | |
download | zsh-2270746356368eb20676bbfb26c82c2a06e694ec.tar.gz zsh-2270746356368eb20676bbfb26c82c2a06e694ec.tar.xz zsh-2270746356368eb20676bbfb26c82c2a06e694ec.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-alternatives | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Completion/Debian/Command/_update-alternatives b/Completion/Debian/Command/_update-alternatives new file mode 100644 index 000000000..dd1d4fce3 --- /dev/null +++ b/Completion/Debian/Command/_update-alternatives @@ -0,0 +1,59 @@ +#compdef update-alternatives + +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 +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 + +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 + [[ -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 |