[Upg] Allow to invoke console from project instead of app directory

This commit is contained in:
Laurent Goussard 2015-01-07 10:39:53 +01:00
parent e5ea9c45be
commit 4faaed9f6c
1 changed files with 5 additions and 4 deletions

View File

@ -38,15 +38,16 @@
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_find_console () {
echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)"
}
_console_get_command_list () { _console_get_command_list () {
php console --no-ansi | sed "1,/Available commands/d" | awk '/ [a-z]+/ { print $1 }' `_find_console` --no-ansi | sed "1,/Available commands/d" | awk '/ [a-z]+/ { print $1 }'
} }
_console () { _console () {
if [ -f console ]; then
compadd `_console_get_command_list` compadd `_console_get_command_list`
fi
} }
compdef _console php console compdef _console php console