]>
Commit | Line | Data |
---|---|---|
67e654f8 WG |
1 | #compdef systemd-inhibit |
2 | ||
3 | _systemd_inhibit_command(){ | |
4 | if (( CURRENT == 1 )); then | |
5 | compset -q | |
6 | _normal | |
7 | else | |
8 | local n=${words[(b:2:i)[^-]*]} | |
9 | if (( n <= CURRENT )); then | |
10 | compset -n $n | |
11 | _alternative \ | |
12 | 'files:file:_files' \ | |
13 | 'commands:command:_normal' && return 0 | |
14 | fi | |
15 | _default | |
16 | fi | |
17 | } | |
18 | ||
298b9e23 WG |
19 | _inhibit_what() { |
20 | local _inhibit | |
21 | _inhibit=(shutdown sleep idle handle-power-key handle-suspend-key handle-hibernate-key handle-lid-switch) | |
22 | _values -s : "${_inhibit[@]}" | |
23 | } | |
24 | ||
67e654f8 WG |
25 | _arguments \ |
26 | {-h,--help}'[Show this help]' \ | |
27 | '--version[Show package version]' \ | |
298b9e23 | 28 | '--what=[Operations to inhibit]:options:_inhibit_what' \ |
fb9d85b7 EC |
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 )' \ | |
67e654f8 WG |
32 | '--list[List active inhibitors]' \ |
33 | '*:commands:_systemd_inhibit_command' |