3 (( $+functions[_machinectl_command] )) || _machinectl_command()
5 local -a _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 "login:Get a login prompt on a VM/container"
11 "poweroff:Power off one or more VMs/containers"
12 "reboot:Reboot one or more VMs/containers"
13 "terminate:Terminate one or more VMs/containers"
14 "kill:Send signal to process or a VM/container"
16 if (( CURRENT == 1 )); then
17 _describe -t commands 'machinectl command' _machinectl_cmds || compadd "$@"
19 local curcontext="$curcontext"
20 cmd="${${_machinectl_cmds[(r)$words[1]:*]%%:*}}"
23 list) msg="no options" ;;
28 _message "no more options"
34 {-h,--help}'[Prints a short help text and exits.]' \
35 '--version[Prints a short version string and exits.]' \
36 \*{-p+,--property=}'[Limit output to specified property.]:property:(Name Id Timestamp TimestampMonotonic Service Scope Leader Class State RootDirectory)' \
37 {-a,--all}'[Show all proerties]' \
38 (-l,--full)'[Do not ellipsize cgroup members]' \
39 '--no-pager[Do not pipe output into a pager]' \
40 '--no-ask-password[Do not ask for system passwords]' \
41 '--kill-who=[Who to send signal to]:killwho:(leader all)' \
42 {-s+,--signal=}'[Which signal to send]:signal:_signals' \
43 {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
44 {-P,--privileged}'[Acquire privileges before execution]' \
45 '*::machinectl command:_machinectl_command'