]>
Commit | Line | Data |
---|---|---|
d74ab852 | 1 | #compdef systemd-run |
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 RC |
5 | __systemctl() { |
6 | local -a _modes | |
7 | _modes=("--user" "--system") | |
8 | systemctl ${words:*_modes} --full --no-legend --no-pager "$@" 2>/dev/null | |
9 | } | |
10 | ||
c501ecd7 | 11 | (( $+functions[__systemd-run_get_slices] )) || |
12 | __systemd-run_get_slices () { | |
d74ab852 RC |
13 | __systemctl list-units --all -t slice \ |
14 | | { while read -r a b; do echo $a; done; }; | |
15 | } | |
16 | ||
c501ecd7 | 17 | (( $+functions[__systemd-run_slices] )) || |
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 | |
23 | } | |
24 | ||
25 | _arguments \ | |
26 | {-h,--help}'[Show help message]' \ | |
27 | '--version[Show package version]' \ | |
28 | '--user[Run as user unit]' \ | |
f49e8bc4 | 29 | {-H+,--host=}'[Operate on remote host]:[user@]host:_sd_hosts_or_user_at_host' \ |
c0fd7cbd | 30 | {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ |
d74ab852 RC |
31 | '--scope[Run this as scope rather than service]' \ |
32 | '--unit=[Run under the specified unit name]:unit name' \ | |
5ffd7671 NC |
33 | {-p+,--property=}'[Set unit property]:NAME=VALUE:(( \ |
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 | ))' \ |
d74ab852 | 48 | '--description=[Description for unit]:description' \ |
c501ecd7 | 49 | '--slice=[Run in the specified slice]:slices:__systemd-run_slices' \ |
d74ab852 RC |
50 | {-r,--remain-after-exit}'[Leave service around until explicitly stopped]' \ |
51 | '--send-sighup[Send SIGHUP when terminating]' \ | |
a80cea68 RC |
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' \ | |
07d61815 DC |
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' \ | |
a80cea68 RC |
62 | '--on-calendar=[Realtime timer]:SPEC' \ |
63 | '--timer-property=[Set timer unit property]:NAME=VALUE' \ | |
c0f9116d | 64 | '--wait=[Wait until service stopped again]' \ |
d74ab852 | 65 | '*::command:_command' |