summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-03-19 22:16:22 +0900
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-03-23 10:11:58 +0100
commit8a43177d80c85e9cb8837544a0ac3132e1461ba6 (patch)
tree12e05e46b7cd94f0c3ae6dfbf0559faf930d31f9
parentc07870bdd7d10b5dbe91e6b24f3d71a8bbfba123 (diff)
downloadsystemd-8a43177d80c85e9cb8837544a0ac3132e1461ba6.tar.gz
shell-completion: systemd-run: add missing options
Closes #19044. (cherry picked from commit c23bb96b388f371e44c4f1756801dec2b4e72307) (cherry picked from commit e60fe377e449f402b61237d6476cde6dadd2e03f) I'm not sure if all options listed in this patch are already there in v246… But at least --slice-inherit which was originally requested in #19044 is here. Worst case, users will get completion to some options which are not there yet.
-rw-r--r--shell-completion/bash/systemd-run20
-rw-r--r--shell-completion/zsh/_systemd-run47
2 files changed, 41 insertions, 26 deletions
diff --git a/shell-completion/bash/systemd-run b/shell-completion/bash/systemd-run
index 88f4443ad9..7e513878c4 100644
--- a/shell-completion/bash/systemd-run
+++ b/shell-completion/bash/systemd-run
@@ -31,20 +31,20 @@ __get_machines() {
_systemd_run() {
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
- local OPTS='-h --help --version --user --system --scope --unit --description --slice
- -r --remain-after-exit --send-sighup -H --host -M --machine --service-type
- --on-active --on-boot --on-startup --on-unit-active --on-unit-inactive
- --on-calendar --timer-property --path-property --socket-property -t --pty
- -q --quiet --no-block --uid --gid --nice -E --setenv -p --property
- --no-ask-password --wait -P --pipe -G --collect --working-directory
- -d --same-dir -S --shell'
+ local OPTS='--no-ask-password --scope -u --unit -p --property --description --slice --slice-inherit
+ -r --remain-after-exit --send-sighup --service-type --uid --gid --nice
+ --working-directory -d --same-dir -E --setenv -t --pty -P --pipe -S --shell -q --quiet
+ --on-active --on-boot --on-startup --on-unit-active --on-unit-inactive --on-calendar
+ --on-clock-change --on-timezone-change --path-property --socket-property
+ --timer-property --no-block --wait -G --collect --user --system -H --host -M --machine
+ -h --help --version'
local mode=--system
local i
local opts_with_values=(
- --unit --description --slice --service-type -H --host -M --machine -p --property --on-active
- --on-boot --on-startup --on-unit-active --on-unit-inactive --on-calendar --timer-property
- --path-property --socket-property --uid --gid --nice -E --setenv --working-directory
+ --unit -p --property --slice --description --service-type --uid --gid --nice --working-directory
+ -E --setenv --on-active --on-boot --on-startup --on-unit-active --on-unit-inactive --on-calendar
+ --path-property --socket-property --timer-property -H --host -M --machine
)
for (( i=1; i <= COMP_CWORD; i++ )); do
if [[ ${COMP_WORDS[i]} != -* ]]; then
diff --git a/shell-completion/zsh/_systemd-run b/shell-completion/zsh/_systemd-run
index 22b82d66fd..ba40c84c79 100644
--- a/shell-completion/zsh/_systemd-run
+++ b/shell-completion/zsh/_systemd-run
@@ -23,13 +23,25 @@ __systemctl() {
}
_arguments \
+ {-G,--collect}'[Unload the transient unit after it completed]' \
+ '--description=[Description for unit]:description' \
+ '--gid=[Run as system group]:group:_groups' \
{-h,--help}'[Show help message]' \
- '--version[Show package version]' \
- '--user[Run as user unit]' \
{-H+,--host=}'[Operate on remote host]:[user@]host:_sd_hosts_or_user_at_host' \
{-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \
- '--scope[Run this as scope rather than service]' \
- '--unit=[Run under the specified unit name]:unit name' \
+ '--nice=[Nice level]:nice level' \
+ '--no-ask-password[Do not query the user for authentication]' \
+ '--no-block[Do not synchronously wait for the unit start operation to finish]' \
+ '--on-active=[Run after SEC seconds]:SEC' \
+ '--on-boot=[Run SEC seconds after machine was booted up]:SEC' \
+ '--on-calendar=[Realtime timer]:SPEC' \
+ '--on-clock-change[Defines a trigger based on system clock jumps]' \
+ '--on-startup=[Run SEC seconds after systemd was first started]:SEC' \
+ '--on-timezone-change[Defines a trigger based on system timezone changes]' \
+ '--on-unit-active=[Run SEC seconds after the last activation]:SEC' \
+ '--on-unit-inactive=[Run SEC seconds after the last deactivation]:SEC' \
+ '--path-property=[Set path unit property]:NAME=VALUE' \
+ {-P,--pipe}'[Inherit standard input, output, and error]' \
{-p+,--property=}'[Set unit property]:NAME=VALUE:(( \
CPUAccounting= MemoryAccounting= BlockIOAccounting= SendSIGHUP= \
SendSIGKILL= MemoryLimit= CPUShares= BlockIOWeight= User= Group= \
@@ -45,21 +57,24 @@ _arguments \
ReadOnlyPaths= InaccessiblePaths= EnvironmentFile= \
ProtectSystem= ProtectHome= RuntimeDirectory= PassEnvironment= \
))' \
- '--description=[Description for unit]:description' \
- '--slice=[Run in the specified slice]:slices:__systemd-run_slices' \
+ {-t,--pty}'[The service connects to the terminal]' \
+ {-q,--quiet}'[Suppresses additional informational output]' \
{-r,--remain-after-exit}'[Leave service around until explicitly stopped]' \
+ {-d,--same-dir}'[Run on the current working directory]' \
+ '--scope[Run this as scope rather than service]' \
'--send-sighup[Send SIGHUP when terminating]' \
'--service-type=[Service type]:type:(simple forking oneshot dbus notify idle)' \
- '--uid=[Run as system user]:user:_users' \
- '--gid=[Run as system group]:group:_groups' \
- '--nice=[Nice level]:nice level' \
- '--setenv=[Set environment]:NAME=VALUE' \
- '--on-active=[Run after SEC seconds]:SEC' \
- '--on-boot=[Run SEC seconds after machine was booted up]:SEC' \
- '--on-startup=[Run SEC seconds after systemd was first started]:SEC' \
- '--on-unit-active=[Run SEC seconds after the last activation]:SEC' \
- '--on-unit-inactive=[Run SEC seconds after the last deactivation]:SEC' \
- '--on-calendar=[Realtime timer]:SPEC' \
+ {-E+,--setenv=}'[Set environment]:NAME=VALUE' \
+ {-S,--shell}'[requests an interactive shell in the current working directory]' \
+ '--slice=[Run in the specified slice]:slices:__systemd-run_slices' \
+ '--slice-inherit[Run in the inherited slice]' \
+ '--socket-property=[Set socket unit property]:NAME=VALUE' \
+ '--system[Run as system unit]' \
'--timer-property=[Set timer unit property]:NAME=VALUE' \
+ '--uid=[Run as system user]:user:_users' \
+ {-u+,--unit=}'[Run under the specified unit name]:unit name' \
+ '--user[Run as user unit]' \
+ '--version[Show package version]' \
'--wait=[Wait until service stopped again]' \
+ '--working-directory=[Run with the specified working directory]' \
'*::command:_command'