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