From 3e7d8cca841755520dbe62b5c25a96a6777dc70f Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Thu, 10 Jul 2014 17:44:54 +0200 Subject: [PATCH] Manage Symfony3 directory structure This structure is already proposed by Symfony 2.5 --- plugins/symfony2/symfony2.plugin.zsh | 35 +++++++++++++++++++++------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh index 4c07349a4..81f8205b6 100644 --- a/plugins/symfony2/symfony2.plugin.zsh +++ b/plugins/symfony2/symfony2.plugin.zsh @@ -1,22 +1,41 @@ # Symfony2 basic command completion + +function _symfony2_console { + if [ -f bin/console ]; then + CONSOLE=bin/console + else + CONSOLE=app/console + fi + + echo $CONSOLE $1 + + php $CONSOLE $1 +} + _symfony2_get_command_list () { - php app/console --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }' + _symfony2_console --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }' } _symfony2 () { - if [ -f app/console ]; then + if [ -f bin/console ]; then + CONSOLE=bin/console + else + CONSOLE=app/console + fi + + if [ -f $CONSOLE ]; then compadd `_symfony2_get_command_list` fi } -compdef _symfony2 app/console +compdef _symfony2 _symfony2_console compdef _symfony2 sf #Alias -alias sf='php app/console' -alias sfcl='php app/console cache:clear' -alias sfroute='php app/console router:debug' -alias sfcontainer='php app/console container:debug' -alias sfgb='php app/console generate:bundle' +alias sf=_symfony2_console +alias sfcl='_symfony2_console cache:clear' +alias sfroute='_symfony2_console router:debug' +alias sfcontainer='_symfony2_console container:debug' +alias sfgb='_symfony2_console generate:bundle'