diff options
| author | nicoulaj <julien.nicoulaud@gmail.com> | 2016-02-17 19:24:04 +0100 |
|---|---|---|
| committer | nicoulaj <julien.nicoulaud@gmail.com> | 2016-02-17 19:24:04 +0100 |
| commit | 6953a4f892df1095e48d43751ccaf9e3ece02190 (patch) | |
| tree | c36d30e918b657a1e5a7f4667ab4bb0f66b7a67e | |
| parent | Merge pull request #383 from pismute/master (diff) | |
| parent | Now autocompletion display the text helper for each command (diff) | |
| download | zsh-completions-0.15.0.tar zsh-completions-0.15.0.tar.gz zsh-completions-0.15.0.tar.bz2 zsh-completions-0.15.0.tar.lz zsh-completions-0.15.0.tar.xz zsh-completions-0.15.0.tar.zst zsh-completions-0.15.0.zip | |
Merge pull request #386 from Cronos87/master0.15.0
Now autocompletion display the text helper for each command
| -rw-r--r-- | src/_console | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/_console b/src/_console index 47f8228..245b0da 100644 --- a/src/_console +++ b/src/_console @@ -35,6 +35,7 @@ # ------- # # * loranger (https://github.com/loranger) +# * Yohan Tambè (https://github.com/Cronos87) # # ------------------------------------------------------------------------------ @@ -43,11 +44,20 @@ _find_console () { } _console_get_command_list () { - `_find_console` --no-ansi | sed "1,/Available commands/d" | awk '/ [a-z]+/ { print $1 }' + IFS=" " + `_find_console` --no-ansi | \ + sed "1,/Available commands/d" | \ + awk '/ [a-z]+/ { print $0 }' | \ + sed -E 's/^[ ]+//g' | \ + sed -E 's/[:]+/\\:/g' | \ + sed -E 's/[ ]{2,}/\:/g' } _console () { - compadd `_console_get_command_list` + local -a commands + IFS=$'\n' + commands=(`_console_get_command_list`) + _describe 'commands' commands } compdef _console php console |
