_systemd-run revision c0fd7cbd7a3a0aab503393e648b33b6ad49ec485
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier#compdef systemd-run
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier__systemctl() {
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier local -a _modes
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier _modes=("--user" "--system")
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier systemctl ${words:*_modes} --full --no-legend --no-pager "$@" 2>/dev/null
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier}
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier__get_slices () {
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier __systemctl list-units --all -t slice \
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier | { while read -r a b; do echo $a; done; };
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier}
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier__slices () {
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier local -a _slices
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier _slices=(${(fo)"$(__get_slices)"})
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier typeset -U _slices
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier _describe 'slices' _slices
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier}
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier_arguments \
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier {-h,--help}'[Show help message]' \
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier '--version[Show package version]' \
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier '--user[Run as user unit]' \
f49e8bc4722aa581f655f81b87608709b6bcda38Ronny Chevalier {-H+,--host=}'[Operate on remote host]:[user@]host:_sd_hosts_or_user_at_host' \
c0fd7cbd7a3a0aab503393e648b33b6ad49ec485William Giokas {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier '--scope[Run this as scope rather than service]' \
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier '--unit=[Run under the specified unit name]:unit name' \
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier '--description=[Description for unit]:description' \
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier '--slice=[Run in the specified slice]:slices:__slices' \
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier {-r,--remain-after-exit}'[Leave service around until explicitly stopped]' \
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier '--send-sighup[Send SIGHUP when terminating]' \
d74ab852161d2dc4093d369495ddfa18460cfd76Ronny Chevalier '*::command:_command'