summaryrefslogtreecommitdiffstats
path: root/shell-completion/zsh/_systemctl.in
diff options
context:
space:
mode:
authorFelix Stupp <felix.stupp@outlook.com>2020-10-29 12:48:48 +0100
committerLennart Poettering <lennart@poettering.net>2021-01-13 16:07:36 +0100
commit4327574fc1093513badc2177f71cede2fc88c13c (patch)
treebc9ffc4c024a5b20d532aab512fd836812f96815 /shell-completion/zsh/_systemctl.in
parentMerge pull request #18225 from poettering/tmpfiles-argument (diff)
downloadsystemd-4327574fc1093513badc2177f71cede2fc88c13c.tar.xz
systemd-4327574fc1093513badc2177f71cede2fc88c13c.zip
Added option --check-inhibitors for non-tty usage
As described in #2680, systemctl did ignore inhibitors if it is not attached to a tty to allow scripts to ignore inhibitors automatically. This pull request preserves this behavior but allows scripts to explicit check inhibitors if required. The new parameter '--check-inhibitors=yes' enables this feature. The old parameter '-i'/'--ignore-inhibitors' was deprecated in favor of '--check-inhibitors=no', the default behaviour can be specified with '--check-inhibitors=auto'. The new parameter is also described in the documentations and shell completions found here.
Diffstat (limited to 'shell-completion/zsh/_systemctl.in')
-rw-r--r--shell-completion/zsh/_systemctl.in9
1 files changed, 8 insertions, 1 deletions
diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in
index 22c40898e3..10af6d5121 100644
--- a/shell-completion/zsh/_systemctl.in
+++ b/shell-completion/zsh/_systemctl.in
@@ -443,6 +443,13 @@ done
_values -s , "${_styles[@]}"
}
+(( $+functions[_systemctl_check_inhibitors] )) ||
+ _systemctl_check_inhibitors() {
+ local -a _modes
+ _modes=(auto yes no)
+ _values -s , "${_modes[@]}"
+ }
+
# Build arguments for "systemctl" to be used in completion.
local -a _modes; _modes=("--user" "--system")
# Use the last mode (they are exclusive and the last one is used).
@@ -460,7 +467,7 @@ _arguments -s \
'--before[Show units ordered before]' \
{-l,--full}"[Don't ellipsize unit names on output]" \
'--show-types[When showing sockets, show socket type]' \
- {-i,--ignore-inhibitors}'[When executing a job, ignore jobs dependencies]' \
+ '--check-inhibitors[Specify if inhibitors should be checked]:mode:_systemctl_check_inhibitors' \
{-q,--quiet}'[Suppress output]' \
'--no-block[Do not wait until operation finished]' \
'--no-legend[Do not print a legend, i.e. the column headers and the footer with hints]' \