summaryrefslogtreecommitdiff
path: root/Completion/Debian/Command/_dchroot
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2006-10-01 21:57:04 +0000
committerClint Adams <clint@users.sourceforge.net>2006-10-01 21:57:04 +0000
commit0fbdf5741fbb06688ab6503f464dbeb31a2c70f8 (patch)
tree5f59a675cd78418871d6ffdd098415dd915a9940 /Completion/Debian/Command/_dchroot
parent3badc3caba2c061e4751f226b1d3d67bcd095848 (diff)
downloadzsh-0fbdf5741fbb06688ab6503f464dbeb31a2c70f8.tar.gz
zsh-0fbdf5741fbb06688ab6503f464dbeb31a2c70f8.zip
22803: updates for dchroot and schroot completion, and new completion for dchroot-dsa.
Diffstat (limited to 'Completion/Debian/Command/_dchroot')
-rw-r--r--Completion/Debian/Command/_dchroot38
1 files changed, 24 insertions, 14 deletions
diff --git a/Completion/Debian/Command/_dchroot b/Completion/Debian/Command/_dchroot
index 7a6973f1b..ba2c5b3fa 100644
--- a/Completion/Debian/Command/_dchroot
+++ b/Completion/Debian/Command/_dchroot
@@ -1,18 +1,28 @@
#compdef dchroot
-local curcontext="$curcontext" state line expl ret=1
+local expl context state line
+typeset -A opt_args
-_arguments -C \
- '(-c -l -h -V)-a[execute in all known chroots]' \
- '(-a -l -h -V)-c[execute in specified chroot]:chroot:->chroots' \
- '(- *)-l[list available chroots]' \
- '(-l)-d[preserve environment in chroot]' \
- '(-h -l -V)-q[be quiet]' \
- '(- *)-h[display help information]' \
- '(- *)-V[display version information]' \
- '*::args: _normal' && ret=0
+_arguments -S \
+ '(-h --help)'{-h,--help}'[help]' \
+ '(-a --all)'{-a,--all}'[select all chroots]' \
+ '*'{-c,--chroot=}'[use specified chroot]:chroot:->chroot' \
+ '(-d --directory)'{-d,--directory=}'[directory to use]:dir:_files -W / -P /' \
+ '(-l --list)'{-l,--list}'[list available chroots]' \
+ '(-i --info)'{-i,--info}'[show information about selected chroots]' \
+ '(-p --path)'{-p,--path}'[print path to selected chroot]' \
+ '--config[dump configuration of selected chroots]' \
+ '(-d --preserve-environment)'{-d,--preserve-environment}'[preserve user environment]' \
+ '(-q --quiet)'{-q,--quiet}'[quiet]' \
+ '(-v --verbose)'{-v,--verbose}'[verbose]' \
+ '(-V --version)'{-V,--version}'[version]' \
+ '(-):command name: _command_names -e' \
+ '*::arguments: _normal' && return 0
-[[ -n $state ]] && _wanted chroots expl chroot \
- compadd ${${$(dchroot -l)[3,-1]%,}:#\[*\]} && ret=0
-
-return ret
+case "$state" in
+ (chroot)
+ _wanted tag expl 'chroot' \
+ compadd ${(os:,:)${${${"$(dchroot -l)"#Available chroots: }/\[*\]/}//[
+]/}}
+ ;;
+esac