_systemd-inhibit revision 67e654f83021a1b3ed55f4b75936d03591bf80c1
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas#compdef systemd-inhibit
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas_systemd_inhibit_command(){
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas if (( CURRENT == 1 )); then
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas compset -q
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas _normal
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas else
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas local n=${words[(b:2:i)[^-]*]}
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas if (( n <= CURRENT )); then
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas compset -n $n
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas _alternative \
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas 'files:file:_files' \
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas 'commands:command:_normal' && return 0
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas fi
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas _default
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas fi
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas}
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas_arguments \
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas {-h,--help}'[Show this help]' \
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas '--version[Show package version]' \
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas '--what=[Operations to inhibit]:options:(shutdown sleep idle handle-power-key handle-suspend-key handle-hibernate-key handle-lid-switch)' \
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas '--who=[A descriptive string who is inhibiting]' \
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas '--why=[A descriptive string why is being inhibited]' \
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas '--mode=[One of block or delay]' \
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas '--list[List active inhibitors]' \
67e654f83021a1b3ed55f4b75936d03591bf80c1William Giokas '*:commands:_systemd_inhibit_command'