1 #compdef systemd-inhibit
2 # SPDX-License-Identifier: LGPL-2.1+
4 _systemd_inhibit_command(){
5 if (( CURRENT == 1 )); then
9 local n=${words[(b:2:i)[^-]*]}
10 if (( n <= CURRENT )); then
14 'commands:command:_normal' && return 0
22 _inhibit=(shutdown sleep idle handle-power-key handle-suspend-key handle-hibernate-key handle-lid-switch)
23 _values -s : "${_inhibit[@]}"
27 {-h,--help}'[Show this help]' \
28 '--version[Show package version]' \
29 '--what=[Operations to inhibit]:options:_inhibit_what' \
30 '--who=[A descriptive string who is inhibiting]:who is inhibiting:' \
31 '--why=[A descriptive string why is being inhibited]:reason for the lock:' \
32 '--mode=[One of block or delay]:lock mode:( block delay )' \
33 '--list[List active inhibitors]' \
34 '*:commands:_systemd_inhibit_command'