[PoC] Improve zsh autocompletions

This commit is contained in:
Andrzej Ressel 2016-07-21 00:02:16 +02:00
parent 11c134509d
commit ceeebaba04
2 changed files with 11 additions and 5 deletions

View File

@ -1,5 +1,11 @@
autoload -U compinit && compinit
autoload -U bashcompinit && bashcompinit
_cli_zsh_autocomplete() {
script_dir=$(dirname $0)
source ${script_dir}/bash_autocomplete
local -a opts
opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-bash-completion)}")
_describe 'values' opts
return
}
compdef _cli_zsh_autocomplete $PROG

View File

@ -129,7 +129,7 @@ func DefaultAppComplete(c *Context) {
continue
}
for _, name := range command.Names() {
fmt.Fprintln(c.App.Writer, name)
fmt.Fprintf(c.App.Writer, "%s:%s\n", name, command.Usage)
}
}
}