]>
Commit | Line | Data |
---|---|---|
f2dec872 | 1 | #compdef systemd-run -*- shell-script -*- |
a032b68d | 2 | # SPDX-License-Identifier: LGPL-2.1-or-later |
60f067b4 | 3 | |
7c20daf6 | 4 | # @todo _systemctl has a helper with the same name, so we must redefine |
60f067b4 | 5 | __systemctl() { |
f2dec872 BR |
6 | local -a _modes |
7 | _modes=("--user" "--system") | |
a10f5d05 | 8 | systemctl ${words:*_modes} --full --no-legend --no-pager --plain "$@" 2>/dev/null |
60f067b4 JS |
9 | } |
10 | ||
7c20daf6 | 11 | (( $+functions[__systemd-run_get_slices] )) || |
f2dec872 | 12 | __systemd-run_get_slices () { |
60f067b4 | 13 | __systemctl list-units --all -t slice \ |
f2dec872 BR |
14 | | { while read -r a b; do echo $a; done; }; |
15 | } | |
60f067b4 | 16 | |
7c20daf6 | 17 | (( $+functions[__systemd-run_slices] )) || |
f2dec872 | 18 | __systemd-run_slices () { |
60f067b4 | 19 | local -a _slices |
7c20daf6 | 20 | _slices=(${(fo)"$(__systemd-run_get_slices)"}) |
60f067b4 JS |
21 | typeset -U _slices |
22 | _describe 'slices' _slices | |
f2dec872 | 23 | } |
60f067b4 JS |
24 | |
25 | _arguments \ | |
3a6ce677 BR |
26 | {-G,--collect}'[Unload the transient unit after it completed]' \ |
27 | '--description=[Description for unit]:description' \ | |
28 | '--gid=[Run as system group]:group:_groups' \ | |
f2dec872 | 29 | {-h,--help}'[Show help message]' \ |
f2dec872 BR |
30 | {-H+,--host=}'[Operate on remote host]:[user@]host:_sd_hosts_or_user_at_host' \ |
31 | {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ | |
3a6ce677 BR |
32 | '--nice=[Nice level]:nice level' \ |
33 | '--no-ask-password[Do not query the user for authentication]' \ | |
34 | '--no-block[Do not synchronously wait for the unit start operation to finish]' \ | |
35 | '--on-active=[Run after SEC seconds]:SEC' \ | |
36 | '--on-boot=[Run SEC seconds after machine was booted up]:SEC' \ | |
37 | '--on-calendar=[Realtime timer]:SPEC' \ | |
38 | '--on-clock-change[Defines a trigger based on system clock jumps]' \ | |
39 | '--on-startup=[Run SEC seconds after systemd was first started]:SEC' \ | |
40 | '--on-timezone-change[Defines a trigger based on system timezone changes]' \ | |
41 | '--on-unit-active=[Run SEC seconds after the last activation]:SEC' \ | |
42 | '--on-unit-inactive=[Run SEC seconds after the last deactivation]:SEC' \ | |
43 | '--path-property=[Set path unit property]:NAME=VALUE' \ | |
44 | {-P,--pipe}'[Inherit standard input, output, and error]' \ | |
f2dec872 | 45 | {-p+,--property=}'[Set unit property]:NAME=VALUE:(( \ |
db2df898 MP |
46 | CPUAccounting= MemoryAccounting= BlockIOAccounting= SendSIGHUP= \ |
47 | SendSIGKILL= MemoryLimit= CPUShares= BlockIOWeight= User= Group= \ | |
8b3d4ff0 | 48 | DevicePolicy= KillMode= ExitType= DeviceAllow= BlockIOReadBandwidth= \ |
db2df898 | 49 | BlockIOWriteBandwidth= BlockIODeviceWeight= Nice= Environment= \ |
e1f67bc7 | 50 | KillSignal= RestartKillSignal= FinalKillSignal= LimitCPU= LimitFSIZE= LimitDATA= \ |
6e866b33 | 51 | LimitSTACK= LimitCORE= LimitRSS= LimitNOFILE= LimitAS= LimitNPROC= \ |
db2df898 MP |
52 | LimitMEMLOCK= LimitLOCKS= LimitSIGPENDING= LimitMSGQUEUE= \ |
53 | LimitNICE= LimitRTPRIO= LimitRTTIME= PrivateTmp= PrivateDevices= \ | |
54 | PrivateNetwork= NoNewPrivileges= WorkingDirectory= RootDirectory= \ | |
55 | TTYPath= SyslogIdentifier= SyslogLevelPrefix= SyslogLevel= \ | |
5a920b42 MP |
56 | SyslogFacility= TimerSlackNSec= OOMScoreAdjust= ReadWritePaths= \ |
57 | ReadOnlyPaths= InaccessiblePaths= EnvironmentFile= \ | |
db2df898 MP |
58 | ProtectSystem= ProtectHome= RuntimeDirectory= PassEnvironment= \ |
59 | ))' \ | |
3a6ce677 BR |
60 | {-t,--pty}'[The service connects to the terminal]' \ |
61 | {-q,--quiet}'[Suppresses additional informational output]' \ | |
f2dec872 | 62 | {-r,--remain-after-exit}'[Leave service around until explicitly stopped]' \ |
3a6ce677 BR |
63 | {-d,--same-dir}'[Run on the current working directory]' \ |
64 | '--scope[Run this as scope rather than service]' \ | |
f2dec872 BR |
65 | '--send-sighup[Send SIGHUP when terminating]' \ |
66 | '--service-type=[Service type]:type:(simple forking oneshot dbus notify idle)' \ | |
3a6ce677 BR |
67 | {-E+,--setenv=}'[Set environment]:NAME=VALUE' \ |
68 | {-S,--shell}'[requests an interactive shell in the current working directory]' \ | |
69 | '--slice=[Run in the specified slice]:slices:__systemd-run_slices' \ | |
70 | '--slice-inherit[Run in the inherited slice]' \ | |
71 | '--socket-property=[Set socket unit property]:NAME=VALUE' \ | |
72 | '--system[Run as system unit]' \ | |
f2dec872 | 73 | '--timer-property=[Set timer unit property]:NAME=VALUE' \ |
3a6ce677 BR |
74 | '--uid=[Run as system user]:user:_users' \ |
75 | {-u+,--unit=}'[Run under the specified unit name]:unit name' \ | |
76 | '--user[Run as user unit]' \ | |
77 | '--version[Show package version]' \ | |
f2dec872 | 78 | '--wait=[Wait until service stopped again]' \ |
3a6ce677 | 79 | '--working-directory=[Run with the specified working directory]' \ |
f2dec872 | 80 | '*::command:_command' |