cfg/.zsh/complete/_config
Knut Ahlers 12c3ebc1d6
Add auto-completion for config command
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2018-10-15 20:41:43 +02:00

25 lines
320 B
Text

#compdef _config config
set -eo pipefail
typeset -A opt_args
function _config() {
#set -x
_arguments -C \
'1:repo:->repos' \
'*::: :->args'
case "$state" in
repos)
local repos
repos=($(ls -1 "${HOME}/.cfg"))
_describe 'repos' repos
;;
args)
_dispatch git -default-
;;
*)
return 1
;;
esac
}