]> git.ipfire.org Git - thirdparty/systemd.git/blob - shell-completion/zsh/_systemd-run
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / shell-completion / zsh / _systemd-run
1 #compdef systemd-run
2 # SPDX-License-Identifier: LGPL-2.1+
3
4 # @todo _systemctl has a helper with the same name, so we must redefine
5 __systemctl() {
6 local -a _modes
7 _modes=("--user" "--system")
8 systemctl ${words:*_modes} --full --no-legend --no-pager "$@" 2>/dev/null
9 }
10
11 (( $+functions[__systemd-run_get_slices] )) ||
12 __systemd-run_get_slices () {
13 __systemctl list-units --all -t slice \
14 | { while read -r a b; do echo $a; done; };
15 }
16
17 (( $+functions[__systemd-run_slices] )) ||
18 __systemd-run_slices () {
19 local -a _slices
20 _slices=(${(fo)"$(__systemd-run_get_slices)"})
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]' \
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:(( \
34 CPUAccounting= MemoryAccounting= BlockIOAccounting= SendSIGHUP= \
35 SendSIGKILL= MemoryLimit= CPUShares= BlockIOWeight= User= Group= \
36 DevicePolicy= KillMode= DeviceAllow= BlockIOReadBandwidth= \
37 BlockIOWriteBandwidth= BlockIODeviceWeight= Nice= Environment= \
38 KillSignal= FinalKillSignal= LimitCPU= LimitFSIZE= LimitDATA= \
39 LimitSTACK= LimitCORE= LimitRSS= LimitNOFILE= LimitAS= LimitNPROC= \
40 LimitMEMLOCK= LimitLOCKS= LimitSIGPENDING= LimitMSGQUEUE= \
41 LimitNICE= LimitRTPRIO= LimitRTTIME= PrivateTmp= PrivateDevices= \
42 PrivateNetwork= NoNewPrivileges= WorkingDirectory= RootDirectory= \
43 TTYPath= SyslogIdentifier= SyslogLevelPrefix= SyslogLevel= \
44 SyslogFacility= TimerSlackNSec= OOMScoreAdjust= ReadWritePaths= \
45 ReadOnlyPaths= InaccessiblePaths= EnvironmentFile= \
46 ProtectSystem= ProtectHome= RuntimeDirectory= PassEnvironment= \
47 ))' \
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'