This commit is contained in:
Dariusz Sadowski 2014-06-26 13:46:37 +00:00
commit 314df4042f

View file

@ -1,21 +1,34 @@
# Symfony2 basic command completion
_symfony2_get_command_list () {
if [ -f bin/console ]; then
php bin/console --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
else
php app/console --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
fi
}
_symfony2 () {
if [ -f app/console ]; then
if [[ (-f app/console) || (-f bin/console) ]]; then
compadd `_symfony2_get_command_list`
fi
}
_symfony2_command () {
if [ -f bin/console ]; then
php bin/console $*
else
php app/console $*
fi
}
compdef _symfony2 app/console
compdef _symfony2 sf
compdef _symfony2 bin/console
compdef _symfony2 _symfony2_command
#Alias
alias sf='php app/console'
alias sfcl='php app/console cache:clear'
alias sfroute='php app/console router:debug'
alias sfgb='php app/console generate:bundle'
alias sf='_symfony2_command'
alias sfcl='_symfony2_command cache:clear'
alias sfroute='_symfony2_command router:debug'
alias sfgb='_symfony2_command generate:bundle'
alias sfcd='_symfony2_command container:debug'