| 1 |
#compdef fnottctl |
| 2 |
|
| 3 |
_arguments \ |
| 4 |
-C \ |
| 5 |
'1:cmd:->cmds' \ |
| 6 |
':id:->id' |
| 7 |
|
| 8 |
case ${state} in |
| 9 |
(cmds) |
| 10 |
local -a commands |
| 11 |
commands=('dismiss:dismiss a notification' |
| 12 |
'actions:show and apply actions for a notification' |
| 13 |
'pause:disable notifications' |
| 14 |
'unpause:re-enable notifications' |
| 15 |
'list:list IDs of all active notifications' |
| 16 |
'quit:stop the fnott daemon') |
| 17 |
|
| 18 |
_arguments \ |
| 19 |
-s \ |
| 20 |
'(-v --version)'{-v,--version}'[show the version number and quit]' \ |
| 21 |
'(-h --help)'{-h,--help}'[show help message and quit]' |
| 22 |
_describe 'command' commands |
| 23 |
ret=0 |
| 24 |
;; |
| 25 |
|
| 26 |
(id) |
| 27 |
case ${line[1]} in |
| 28 |
(actions|dismiss) |
| 29 |
local -a ids |
| 30 |
ids=("${(f)$(fnottctl list)}") |
| 31 |
|
| 32 |
if [[ "${line[1]}" == "dismiss" ]]; then |
| 33 |
ids+=('all:all notifications') |
| 34 |
fi |
| 35 |
|
| 36 |
_describe 'notification' ids |
| 37 |
ret=0 |
| 38 |
;; |
| 39 |
esac |
| 40 |
;; |
| 41 |
esac |
| 42 |
|
| 43 |
return 1 |