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

8
dist/web-greeter-zsh vendored

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

Loading…
Cancel
Save