-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zsh completion script for dunst (#1108)
* zsh completion script for dunst * typo fix * Update and rename _dunst to _dunst.zshcomp * Update _dunst.zshcomp * Update _dunst.zshcomp
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |