]>
Commit | Line | Data |
---|---|---|
c1072f64 | 1 | #compdef systemd-run -*- shell-script -*- |
7059062c | 2 | # SPDX-License-Identifier: LGPL-2.1+ |
d74ab852 | 3 | |
c501ecd7 | 4 | # @todo _systemctl has a helper with the same name, so we must redefine |
d74ab852 | 5 | __systemctl() { |
843cfcb1 ZJS |
6 | local -a _modes |
7 | _modes=("--user" "--system") | |
8 | systemctl ${words:*_modes} --full --no-legend --no-pager "$@" 2>/dev/null | |
d74ab852 RC |
9 | } |
10 | ||
c501ecd7 | 11 | (( $+functions[__systemd-run_get_slices] )) || |
843cfcb1 | 12 | __systemd-run_get_slices () { |
d74ab852 | 13 | __systemctl list-units --all -t slice \ |
843cfcb1 ZJS |
14 | | { while read -r a b; do echo $a; done; }; |
15 | } | |
d74ab852 | 16 | |
c501ecd7 | 17 | (( $+functions[__systemd-run_slices] )) || |
843cfcb1 | 18 | __systemd-run_slices () { |
d74ab852 | 19 | local -a _slices |
c501ecd7 | 20 | _slices=(${(fo)"$(__systemd-run_get_slices)"}) |
d74ab852 RC |
21 | typeset -U _slices |
22 | _describe 'slices' _slices | |
843cfcb1 | 23 | } |
d74ab852 RC |
24 | |
25 | _arguments \ | |
843cfcb1 ZJS |
26 | {-h,--help}'[Show help message]' \ |
27 | '--version[Show package version]' \ | |
28 | '--user[Run as user unit]' \ | |
29 | {-H+,--host=}'[Operate on remote host]:[user@]host:_sd_hosts_or_user_at_host' \ | |
30 | {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ | |
31 | '--scope[Run this as scope rather than service]' \ | |
32 | '--unit=[Run under the specified unit name]:unit name' \ | |
33 | {-p+,--property=}'[Set unit property]:NAME=VALUE:(( \ | |
5ffd7671 NC |
34 | CPUAccounting= MemoryAccounting= BlockIOAccounting= SendSIGHUP= \ |
35 | SendSIGKILL= MemoryLimit= CPUShares= BlockIOWeight= User= Group= \ | |
36 | DevicePolicy= KillMode= DeviceAllow= BlockIOReadBandwidth= \ | |
37 | BlockIOWriteBandwidth= BlockIODeviceWeight= Nice= Environment= \ | |
fbb48d4c JR |
38 | KillSignal= FinalKillSignal= LimitCPU= LimitFSIZE= LimitDATA= \ |
39 | LimitSTACK= LimitCORE= LimitRSS= LimitNOFILE= LimitAS= LimitNPROC= \ | |
5ffd7671 NC |
40 | LimitMEMLOCK= LimitLOCKS= LimitSIGPENDING= LimitMSGQUEUE= \ |
41 | LimitNICE= LimitRTPRIO= LimitRTTIME= PrivateTmp= PrivateDevices= \ | |
42 | PrivateNetwork= NoNewPrivileges= WorkingDirectory= RootDirectory= \ | |
43 | TTYPath= SyslogIdentifier= SyslogLevelPrefix= SyslogLevel= \ | |
2a624c36 AP |
44 | SyslogFacility= TimerSlackNSec= OOMScoreAdjust= ReadWritePaths= \ |
45 | ReadOnlyPaths= InaccessiblePaths= EnvironmentFile= \ | |
b4c14404 | 46 | ProtectSystem= ProtectHome= RuntimeDirectory= PassEnvironment= \ |
5ffd7671 | 47 | ))' \ |
843cfcb1 ZJS |
48 | '--description=[Description for unit]:description' \ |
49 | '--slice=[Run in the specified slice]:slices:__systemd-run_slices' \ | |
50 | {-r,--remain-after-exit}'[Leave service around until explicitly stopped]' \ | |
51 | '--send-sighup[Send SIGHUP when terminating]' \ | |
52 | '--service-type=[Service type]:type:(simple forking oneshot dbus notify idle)' \ | |
53 | '--uid=[Run as system user]:user:_users' \ | |
54 | '--gid=[Run as system group]:group:_groups' \ | |
55 | '--nice=[Nice level]:nice level' \ | |
56 | '--setenv=[Set environment]:NAME=VALUE' \ | |
57 | '--on-active=[Run after SEC seconds]:SEC' \ | |
58 | '--on-boot=[Run SEC seconds after machine was booted up]:SEC' \ | |
59 | '--on-startup=[Run SEC seconds after systemd was first started]:SEC' \ | |
60 | '--on-unit-active=[Run SEC seconds after the last activation]:SEC' \ | |
61 | '--on-unit-inactive=[Run SEC seconds after the last deactivation]:SEC' \ | |
62 | '--on-calendar=[Realtime timer]:SPEC' \ | |
63 | '--timer-property=[Set timer unit property]:NAME=VALUE' \ | |
64 | '--wait=[Wait until service stopped again]' \ | |
65 | '*::command:_command' |