summaryrefslogtreecommitdiff
path: root/shell-completion/zsh/_systemd-inhibit
diff options
context:
space:
mode:
Diffstat (limited to 'shell-completion/zsh/_systemd-inhibit')
-rw-r--r--shell-completion/zsh/_systemd-inhibit8
1 files changed, 5 insertions, 3 deletions
diff --git a/shell-completion/zsh/_systemd-inhibit b/shell-completion/zsh/_systemd-inhibit
index 764713e28a..7c40e49ae4 100644
--- a/shell-completion/zsh/_systemd-inhibit
+++ b/shell-completion/zsh/_systemd-inhibit
@@ -1,7 +1,8 @@
#compdef systemd-inhibit
# SPDX-License-Identifier: LGPL-2.1+
-_systemd_inhibit_command(){
+(( $+functions[_systemd-inhibit_commands] )) ||
+_systemd-inhibit_commands(){
if (( CURRENT == 1 )); then
compset -q
_normal
@@ -17,7 +18,8 @@ _systemd_inhibit_command(){
fi
}
-_inhibit_what() {
+(( $+functions[_systemd-inhibit_what] )) ||
+_systemd-inhibit_what() {
local _inhibit
_inhibit=(shutdown sleep idle handle-power-key handle-suspend-key handle-hibernate-key handle-lid-switch)
_values -s : "${_inhibit[@]}"
@@ -31,4 +33,4 @@ _arguments \
'--why=[A descriptive string why is being inhibited]:reason for the lock:' \
'--mode=[One of block or delay]:lock mode:( block delay )' \
'--list[List active inhibitors]' \
- '*:commands:_systemd_inhibit_command'
+ '*:commands:_systemd-inhibit_commands'