]> git.ipfire.org Git - thirdparty/systemd.git/blob - shell-completion/zsh/_systemd-run
pkgconfig: define variables relative to ${prefix}/${rootprefix}/${sysconfdir}
[thirdparty/systemd.git] / shell-completion / zsh / _systemd-run
1 #compdef systemd-run
2 # SPDX-License-Identifier: LGPL-2.1+
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]' \
26 {-H+,--host=}'[Operate on remote host]:[user@]host:_sd_hosts_or_user_at_host' \
27 {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \
28 '--scope[Run this as scope rather than service]' \
29 '--unit=[Run under the specified unit name]:unit name' \
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= FinalKillSignal= LimitCPU= LimitFSIZE= LimitDATA= \
36 LimitSTACK= 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= \
41 SyslogFacility= TimerSlackNSec= OOMScoreAdjust= ReadWritePaths= \
42 ReadOnlyPaths= InaccessiblePaths= EnvironmentFile= \
43 ProtectSystem= ProtectHome= RuntimeDirectory= PassEnvironment= \
44 ))' \
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]' \
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' \
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' \
59 '--on-calendar=[Realtime timer]:SPEC' \
60 '--timer-property=[Set timer unit property]:NAME=VALUE' \
61 '--wait=[Wait until service stopped again]' \
62 '*::command:_command'