Browse Source

Bash and Zsh completion updated

sisyphus
JezerM 3 years ago
parent
commit
9d661a14ba
No known key found for this signature in database
GPG Key ID: 66BBC5D01388C6B5
  1. 3
      dist/web-greeter-bash
  2. 8
      dist/web-greeter-zsh

3
dist/web-greeter-bash vendored

@ -9,12 +9,13 @@ _web-greeter() {
case "${last}" in
--theme)
_filedir
options=$(ls -1d /usr/share/web-greeter/themes/*/ | cut -c 1- |
rev | cut -c 2- | rev | sort | sed 's/\/usr\/share\/web-greeter\/themes\///')
;;
esac
COMPREPLY=( $(compgen -W "${options}" -- "${cur}") )
COMPREPLY+=( $(compgen -W "${options}" -- "${cur}") )
}
complete -F _web-greeter web-greeter

8
dist/web-greeter-zsh vendored

@ -9,13 +9,19 @@ _webgreeter() {
'--debug[Runs the greeter in debug mode]'
'--normal[Runs in non-debug mode]'
'--list[Lists available themes]'
"--theme[Sets the theme to use]:theme:(${themes})"
"--theme[Sets the theme to use]:theme:->themes"
'--help[Show help]'
'-h[Show help]'
'--version[Print program version]'
'-v[Print program version]'
)
_arguments $args[@] && ret=0
case "$state" in
themes)
_files
_values 'themes' "${(uonzf)${themes}}"
;;
esac
return ret
}

Loading…
Cancel
Save