summaryrefslogtreecommitdiff
path: root/plugins/symfony2/symfony2.plugin.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/symfony2/symfony2.plugin.zsh')
-rw-r--r--plugins/symfony2/symfony2.plugin.zsh26
1 files changed, 16 insertions, 10 deletions
diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh
index 0d2bb68c3..e94280ed0 100644
--- a/plugins/symfony2/symfony2.plugin.zsh
+++ b/plugins/symfony2/symfony2.plugin.zsh
@@ -1,21 +1,27 @@
# Symfony2 basic command completion
+_symfony_console () {
+ echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)"
+}
+
_symfony2_get_command_list () {
- php app/console --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
+ `_symfony_console` --no-ansi | sed "1,/Available commands/d" | awk '/^ ?[a-z]+/ { print $1 }'
}
_symfony2 () {
- if [ -f app/console ]; then
- compadd `_symfony2_get_command_list`
- fi
+ compadd `_symfony2_get_command_list`
}
-compdef _symfony2 app/console
+compdef _symfony2 '`_symfony_console`'
+compdef _symfony2 'app/console'
+compdef _symfony2 'bin/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 sfgb='php app/console generate:bundle'
-
+alias sf='`_symfony_console`'
+alias sfcl='sf cache:clear'
+alias sfsr='sf server:run -vvv'
+alias sfcw='sf cache:warmup'
+alias sfroute='sf router:debug'
+alias sfcontainer='sf container:debug'
+alias sfgb='sf generate:bundle'