Merge branch 'zsh' of https://github.com/jereksel/cli into jereksel-zsh

This commit is contained in:
Dan Buch 2016-07-24 17:12:43 -04:00
commit 1cbb9a7f30
No known key found for this signature in database
GPG Key ID: FAEF12936DD3E3EC
2 changed files with 11 additions and 5 deletions

View File

@ -1,5 +1,11 @@
autoload -U compinit && compinit _cli_zsh_autocomplete() {
autoload -U bashcompinit && bashcompinit
script_dir=$(dirname $0) local -a opts
source ${script_dir}/bash_autocomplete 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 continue
} }
for _, name := range command.Names() { for _, name := range command.Names() {
fmt.Fprintln(c.App.Writer, name) fmt.Fprintf(c.App.Writer, "%s:%s\n", name, command.Usage)
} }
} }
} }