chiark / gitweb /
026d74fca406933e0947ff8dc9ef1303e5419a9b
[elogind.git] / shell-completion / zsh / _machinectl
1 #compdef machinectl
2
3 (( $+functions[_machinectl_command] )) || _machinectl_command()
4 {
5   local -a _machinectl_cmds
6   _machinectl_cmds=(
7     "list:List currently running VMs/containers"
8     "status:Show VM/container status"
9     "show:Show properties of one or more VMs/containers"
10     "terminate:Terminate one or more VMs/containers"
11     "kill:Send signal to process or a VM/container"
12   )
13   if (( CURRENT == 1 )); then
14     _describe -t commands 'machinectl command' _machinectl_cmds || compadd "$@"
15   else
16     local curcontext="$curcontext"
17     cmd="${${_machinectl_cmds[(r)$words[1]:*]%%:*}}"
18     if (( $#cmd )); then
19       case $cmd in
20         list) msg="no options" ;;
21         *)
22           _sd_machines
23       esac
24     else
25       _message "no more options"
26     fi
27   fi
28 }
29
30 _arguments \
31   {-h,--help}'[Prints a short help text and exits.]' \
32   '--version[Prints a short version string and exits.]' \
33   \*{-p+,--property=}'[Limit output to specified property.]:property:(Name Id Timestamp TimestampMonotonic Service Scope Leader Class State RootDirectory)' \
34   {-a,--all}'[Show all proerties]' \
35   (-l,--full)'[Do not ellipsize cgroup members]' \
36   '--no-pager[Do not pipe output into a pager]' \
37   '--no-ask-password[Do not ask for system passwords]' \
38   '--kill-who=[Who to send signal to]:killwho:(leader all)' \
39   {-s+,--signal=}'[Which signal to send]:signal:_signals' \
40   {-H+,--host=}'[Show information for remote host]:userathost:_sd_hosts_or_user_at_host' \
41   {-P,--privileged}'[Acquire privileges before execution]' \
42   '*::machinectl command:_machinectl_command'