summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_dsh
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2014-08-14 19:02:48 +0200
committerOliver Kiddle <opk@zsh.org>2014-08-14 19:02:48 +0200
commit2be0d8bdef401b6bca0c80a7bd78d658e862e38e (patch)
treee3ce3b6308647cb5fe6eb5122aad0a0daa917f28 /Completion/Unix/Command/_dsh
parent469ee6daef50d0736a38f646bd9eb659b7aad6d1 (diff)
downloadzsh-2be0d8bdef401b6bca0c80a7bd78d658e862e38e.tar.gz
zsh-2be0d8bdef401b6bca0c80a7bd78d658e862e38e.zip
32998: completion function updates
Diffstat (limited to 'Completion/Unix/Command/_dsh')
-rw-r--r--Completion/Unix/Command/_dsh33
1 files changed, 33 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_dsh b/Completion/Unix/Command/_dsh
new file mode 100644
index 000000000..688e024ce
--- /dev/null
+++ b/Completion/Unix/Command/_dsh
@@ -0,0 +1,33 @@
+#compdef dsh
+
+local curcontext="$curcontext" state line expl
+typeset -A opt_args
+
+_arguments -s -C -S \
+ '(-v --verbose -q --quiet)'{-v,--verbose}'[verbose output]' \
+ '(-q --quiet -v --verbose)'{-q,--quiet}'[quieter output]' \
+ '(-M --show-machine-names)'{-M,--show-machine-names}'[prepend the host name on output]' \
+ '(-i --duplicate-input)'{-i,--duplicate-input}'[duplicate input given to dsh]' \
+ '(-b --bufsize)'{-b,--bufsize}'[change buffer size used in input duplication]:buffer size for -i (bytes)' \
+ '(-m --machine)'{-m,--machine}'[execute on machine]:machine:{_hosts || _user_at_host}' \
+ '(-n --num-topology)'{-n,--num-topology}'[how to divide the machines]:number' \
+ '(-a --all)'{-a,--all}'[execute on all machines]' \
+ '(-g --group)'{-g,--group}'[execute on group member]:groupname:->groups' \
+ '(-f --file)'{-f,--file}'[use the file as list of machines]:file:_files' \
+ '(-r --remoteshell)'{-r,--remoteshell}'[execute using shell]:remote shell:(rsh ssh)' \
+ '(-o --remoteshellopt)'{-o,--remoteshellopt}'[option to give to remote shell ]:option' \
+ '(-)'{-h,--help}'[display help information]' \
+ '(-w --wait-shell -c --concurrent-shell)'{-w,--wait-shell}'[sequentially execute shell]' \
+ '(-c --concurrent-shell -w --wait-shell)'{-c,--concurrent-shell}'[execute shell concurrently]' \
+ '(-F --forklimit)'{-F,--forklimit}'[concurrent with limit on number]:fork limit' \
+ '(-)'{-V,--version}'[display version information]' \
+ '*::args: _normal' && return
+
+if [[ $state = groups ]]; then
+ if ! zstyle -s ":completion:$curcontext:dsh-groups" dsh-groups grp; then
+ [[ -e ~/.dsh/group ]] && grp="~/.dsh/group" || return 1
+ fi
+ _path_files -W ~/.dsh/group && return
+fi
+
+return 1