Skip to content

Commit

Permalink
Merge pull request sorin-ionescu#398 from Cronos87/master
Browse files Browse the repository at this point in the history
Now Artisan autocompletion display the text helper for each command
  • Loading branch information
nicoulaj committed Apr 26, 2016
2 parents 3e81c15 + de17e99 commit 654252f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions src/_artisan
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,27 @@
# -------
#
# * loranger (https://github.com/loranger)
# * Yohan Tambè (https://github.com/Cronos87)
#
# ------------------------------------------------------------------------------


_artisan_get_command_list () {
php artisan --no-ansi | sed "1,/Available commands/d" | awk '/ [a-z]+/ { print $1 }'
IFS=" "
php artisan --no-ansi | \
sed "1,/Available commands/d" | \
awk '/ [a-z]+/ { print $1 }' | \
sed -E 's/^[ ]+//g' | \
sed -E 's/[:]+/\\:/g' | \
sed -E 's/[ ]{2,}/\:/g'
}

_artisan () {
if [ -f artisan ]; then
compadd `_artisan_get_command_list`
local -a commands
IFS=$'\n'
commands=(`_artisan_get_command_list`)
_describe 'commands' commands
fi
}

Expand Down
2 changes: 1 addition & 1 deletion src/_console
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ _console_get_command_list () {
IFS=" "
`_find_console` --no-ansi | \
sed "1,/Available commands/d" | \
awk '/ [a-z]+/ { print $0 }' | \
awk '/ [a-z]+/ { print $0 }' | \
sed -E 's/^[ ]+//g' | \
sed -E 's/[:]+/\\:/g' | \
sed -E 's/[ ]{2,}/\:/g'
Expand Down

0 comments on commit 654252f

Please sign in to comment.