_machinectl revision 4433c995c77b66f42fe4a238aff6b53706628a2e
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas#compdef machinectl
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas(( $+functions[_machinectl_command] )) || _machinectl_command()
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas local -a _machinectl_cmds
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas _machinectl_cmds=(
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas "list:List currently running VMs/containers"
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas "status:Show VM/container status"
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas "show:Show properties of one or more VMs/containers"
4433c995c77b66f42fe4a238aff6b53706628a2eDaniel Mack "login:Get a login prompt on a VM/container"
4433c995c77b66f42fe4a238aff6b53706628a2eDaniel Mack "poweroff:Power off one or more VMs/containers"
4433c995c77b66f42fe4a238aff6b53706628a2eDaniel Mack "reboot:Reboot one or more VMs/containers"
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas "terminate:Terminate one or more VMs/containers"
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas "kill:Send signal to process or a VM/container"
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas if (( CURRENT == 1 )); then
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas _describe -t commands 'machinectl command' _machinectl_cmds || compadd "$@"
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas local curcontext="$curcontext"
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas cmd="${${_machinectl_cmds[(r)$words[1]:*]%%:*}}"
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas if (( $#cmd )); then
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas list) msg="no options" ;;
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas _message "no more options"
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas {-h,--help}'[Prints a short help text and exits.]' \
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas '--version[Prints a short version string and exits.]' \
862f4963c6f7778cea9e715eeb11ea959eba6db3William Giokas \*{-p+,--property=}'[Limit output to specified property.]:property:(Name Id Timestamp TimestampMonotonic Service Scope Leader Class State RootDirectory)' \
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas {-a,--all}'[Show all proerties]' \
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas (-l,--full)'[Do not ellipsize cgroup members]' \
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas '--no-pager[Do not pipe output into a pager]' \
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas '--no-ask-password[Do not ask for system passwords]' \
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas '--kill-who=[Who to send signal to]:killwho:(leader all)' \
862f4963c6f7778cea9e715eeb11ea959eba6db3William Giokas {-s+,--signal=}'[Which signal to send]:signal:_signals' \
6da49b8b2f78fd74bb33de961ef8a4c7f727b822Zbigniew Jędrzejewski-Szmek {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas {-P,--privileged}'[Acquire privileges before execution]' \
439b7ce868810427712ca146b94b7fb004abfbb4William Giokas '*::machinectl command:_machinectl_command'