summaryrefslogtreecommitdiff
path: root/shell-completion/zsh
diff options
context:
space:
mode:
authorRonny Chevalier <chevalier.ronny@gmail.com>2013-10-31 20:46:29 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-11-07 01:23:54 -0500
commitf49e8bc4722aa581f655f81b87608709b6bcda38 (patch)
tree902cbda0a65d3c852d8d975b32174164683c3f17 /shell-completion/zsh
parentc5383e7942e5d7323406feec2f35ff25a7771919 (diff)
zsh-completion: add missing options for systemd-run
Diffstat (limited to 'shell-completion/zsh')
-rw-r--r--shell-completion/zsh/_systemd-run17
1 files changed, 17 insertions, 0 deletions
diff --git a/shell-completion/zsh/_systemd-run b/shell-completion/zsh/_systemd-run
index 0c81c543c5..4bfbd196ca 100644
--- a/shell-completion/zsh/_systemd-run
+++ b/shell-completion/zsh/_systemd-run
@@ -18,10 +18,27 @@ __slices () {
_describe 'slices' _slices
}
+__get_machines () {
+ machinectl --full --no-pager list | {while read -r a b; do echo $a; done;};
+}
+
+__machines () {
+ local -a _machines
+ _machines=("${(fo)$(__get_machines)}")
+ typeset -U _machines
+ if [[ -n "$_machines" ]]; then
+ _describe 'machines' _machines
+ else
+ _message 'no machines'
+ fi
+}
+
_arguments \
{-h,--help}'[Show help message]' \
'--version[Show package version]' \
'--user[Run as user unit]' \
+ {-H+,--host=}'[Operate on remote host]:[user@]host:_sd_hosts_or_user_at_host' \
+ {-M+,--machine=}'[Operate on local container]:machines:__machines' \
'--scope[Run this as scope rather than service]' \
'--unit=[Run under the specified unit name]:unit name' \
'--description=[Description for unit]:description' \