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