| 1 |
#compdef run0 |
| 2 |
|
| 3 |
(( $+functions[_run0_unit_properties] )) || |
| 4 |
_run0_unit_properties() { |
| 5 |
local -a props=( |
| 6 |
BlockIOAccounting BlockIODeviceWeight BlockIOReadBandwidth |
| 7 |
BlockIOWeight BlockIOWriteBandwidth CPUAccounting |
| 8 |
CPUShares DeviceAllow DevicePolicy |
| 9 |
Environment EnvironmentFile ExitType |
| 10 |
FinalKillSignal Group InaccessiblePaths |
| 11 |
KillMode KillSignal LimitAS |
| 12 |
LimitCORE LimitCPU LimitDATA |
| 13 |
LimitFSIZE LimitLOCKS LimitMEMLOCK |
| 14 |
LimitMSGQUEUE LimitNICE LimitNOFILE |
| 15 |
LimitNPROC LimitRSS LimitRTPRIO |
| 16 |
LimitRTTIME LimitSIGPENDING LimitSTACK |
| 17 |
MemoryAccounting MemoryLimit Nice |
| 18 |
NoNewPrivileges OOMScoreAdjust PassEnvironment |
| 19 |
PrivateDevices PrivateNetwork PrivateTmp |
| 20 |
ProtectHome ProtectSystem ReadOnlyPaths |
| 21 |
ReadWritePaths RestartKillSignal RootDirectory |
| 22 |
RuntimeDirectory SendSIGHUP SendSIGKILL |
| 23 |
SyslogFacility SyslogIdentifier SyslogLevel |
| 24 |
SyslogLevelPrefix TTYPath TimerSlackNSec |
| 25 |
User WorkingDirectory |
| 26 |
) |
| 27 |
_values -S= 'properties' ${^props}'::()' |
| 28 |
} |
| 29 |
|
| 30 |
(( $+functions[_run0_slices] )) || |
| 31 |
_run0_slices() { |
| 32 |
local -a slices=( |
| 33 |
${(@f)"$(_call_program slice-units systemctl --no-pager --legend=no --plain list-units --all -t slice 2>/dev/null)"} |
| 34 |
) |
| 35 |
slices=( ${slices%% *} ) |
| 36 |
_describe -t slice-units 'slice unit' slices |
| 37 |
} |
| 38 |
|
| 39 |
local -a args=( |
| 40 |
'--no-ask-password[Do not query the user for authentication]' |
| 41 |
'--unit=[Use this unit name instead of an automatically generated one]' |
| 42 |
{'*--property=','*-p+'}'[Sets a property on the service unit created]:property:_run0_unit_properties' |
| 43 |
'--description=[Provide a description for the service unit]:TEXT' |
| 44 |
'--slice=[Make the new .service unit part of the specified slice]:slice unit:_run0_slices' |
| 45 |
'--slice-inherit[Make the new service unit part of the current slice]' |
| 46 |
'(--user -u)'{--user=,-u+}'[Switch to the specified user]:user:_users' |
| 47 |
'(--group -g)'{--group=,-g+}'[Switch to the specified group]:group:_groups' |
| 48 |
'--nice=[Run with specified nice level]:nice value' |
| 49 |
'(--chdir -D -i --same-root-dir)'{--chdir=,-D+}'[Run within the specified working directory]:directory:_files -/' |
| 50 |
'(-i)'--via-shell"[Invoke command via target user's login shell]" |
| 51 |
'(--via-shell --chdir -D --same-root-dir)'-i"[Shortcut for --via-shell --chdir='~']" |
| 52 |
'*--setenv=[Set the specified environment variable in the session]:environment variable:_parameters -g "*export*" -S = -q' |
| 53 |
'--background=[Change the terminal background color to the specified ANSI color]:ansi color' |
| 54 |
'(--pty-late --pipe)'--pty'[Request allocation of a pseudo TTY for stdio]' |
| 55 |
'(--pty --pipe)'--pty-late'[Just like --pty, but leave TTY access to agents until unit is started up]' |
| 56 |
"(--pty --pty-late)--pipe[request passing the caller's STDIO file descriptors directly through]" |
| 57 |
'--shell-prompt-prefix=[Set $SHELL_PROMPT_PREFIX]:PREFIX' |
| 58 |
'--lightweight=[Control whether to register a session with service manager or without]:bool:_values bool true false' |
| 59 |
'--machine=[Execute the operation on a local container]:machine:_sd_machines' |
| 60 |
'--area=[Home area to log into]:AREA' |
| 61 |
'(- *)'{-h,--help}'[Show the help text and exit]' |
| 62 |
'(- *)'{-V,--version}'[Print a short version string and exit]' |
| 63 |
'--empower[Give privileges to selected or current user]' |
| 64 |
'(--chdir -D -i)--same-root-dir[Execute the run0 session in the same root directory that the run0 command is executed in]' |
| 65 |
) |
| 66 |
|
| 67 |
_arguments -S $args '*:: :{_normal -p $service}' |