Skip to content

Commit

Permalink
zsh completion script for dunst (#1108)
Browse files Browse the repository at this point in the history
* zsh completion script for dunst

* typo fix

* Update and rename _dunst to _dunst.zshcomp

* Update _dunst.zshcomp

* Update _dunst.zshcomp
  • Loading branch information
elig0n authored Oct 19, 2022
1 parent 1ef38e5 commit 3a3636c
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions contrib/_dunst.zshcomp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#compdef _dunst dunst

# ZSH arguments completion script for the dunst command

local curcontext="$curcontext" ret=1
local -a state line subs

_arguments -C \
'1:opt:->opts' \
'2:param:->params' \
&& ret=0

case $state in
(opts)
_arguments \
{-v,--version,-version}"[Print version]" \
'(-verbosity)-verbosity[Minimum level for message]' \
{-conf,--config}"[Path to configuration file]:file:_files" \
{-h,-help,--help}"[Print help]"
;;

(params)
case $line[1] in
-verbosity)
local -a verbosity_params;
verbosity_params=(
"crit"
"warn"
"mesg"
"info"
"debug"
)
_describe verbosity_params verbosity_params && ret=0
;;

-conf|--config)
_arguments '*:file:_files' && ret=0
;;

esac
esac

0 comments on commit 3a3636c

Please sign in to comment.