mirror of
https://github.com/zsh-users/zsh-completions.git
synced 2026-09-23 05:14:43 +00:00
Merge pull request #386 from Cronos87/master
Now autocompletion display the text helper for each command
This commit is contained in:
+12
-2
@@ -35,6 +35,7 @@
|
|||||||
# -------
|
# -------
|
||||||
#
|
#
|
||||||
# * loranger (https://github.com/loranger)
|
# * loranger (https://github.com/loranger)
|
||||||
|
# * Yohan Tambè (https://github.com/Cronos87)
|
||||||
#
|
#
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -43,11 +44,20 @@ _find_console () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_console_get_command_list () {
|
_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 () {
|
_console () {
|
||||||
compadd `_console_get_command_list`
|
local -a commands
|
||||||
|
IFS=$'\n'
|
||||||
|
commands=(`_console_get_command_list`)
|
||||||
|
_describe 'commands' commands
|
||||||
}
|
}
|
||||||
|
|
||||||
compdef _console php console
|
compdef _console php console
|
||||||
|
|||||||
Reference in New Issue
Block a user