| 1 |
#compdef makoctl |
| 2 |
|
| 3 |
local -a makoctl_cmds |
| 4 |
|
| 5 |
makoctl_cmds=( |
| 6 |
'dismiss:Dismiss notification (first by default)' |
| 7 |
'restore:Restore the most recently expired notification from the history buffer' |
| 8 |
'invoke:Invoke an action on the first notification. If action is not specified, invoke the default action' |
| 9 |
'menu:Use a program to select one action to be invoked on the notification' |
| 10 |
'list:Retrieve a list of current notifications' |
| 11 |
'history:Retrieve a list of dismissed notifications' |
| 12 |
'reload:Reload the configuration file' |
| 13 |
'mode:List, activate, or deactivate modes' |
| 14 |
'help:Show help message and quit' |
| 15 |
) |
| 16 |
|
| 17 |
if (( CURRENT == 2 )); then |
| 18 |
_describe 'makoctl command' makoctl_cmds |
| 19 |
else |
| 20 |
shift words |
| 21 |
(( CURRENT-- )) |
| 22 |
opt="${words[1]}" |
| 23 |
|
| 24 |
if (( CURRENT == 2 )); then |
| 25 |
case "${opt}" in |
| 26 |
dismiss) |
| 27 |
_arguments -s \ |
| 28 |
'(-a --all)'{-a,--all}'[Dismiss all notifications]' \ |
| 29 |
'(-g --group)'{-g,--group}'[Dismiss all the notifications in the last notification'\''s group]' \ |
| 30 |
'(-h --no-history)'{-h,--no-history}'[Dismiss without adding to history]' \ |
| 31 |
'-n[Dismiss the notification with the given id]:id:' |
| 32 |
;; |
| 33 |
invoke) |
| 34 |
_arguments -s \ |
| 35 |
'-n[Invoke an action on the notification with the given id]:id:' \ |
| 36 |
'*:action:' |
| 37 |
;; |
| 38 |
menu) |
| 39 |
_arguments -s \ |
| 40 |
'-n[Use a program to select one action on the notification with the given id]:id:' \ |
| 41 |
'*:prog and args:_command_names -e' |
| 42 |
;; |
| 43 |
mode) |
| 44 |
_arguments -s \ |
| 45 |
'*-a[Add mode]:mode:' \ |
| 46 |
'*-r[Remove mode]:mode:' \ |
| 47 |
'*-t[Toggle mode]:mode:' \ |
| 48 |
'*-s[Set mode]:mode:' |
| 49 |
;; |
| 50 |
esac |
| 51 |
fi |
| 52 |
fi |