symfony2.plugin.zsh 746 B

1234567891011121314151617181920212223242526272829
  1. # Symfony2 basic command completion
  2. _symfony_console () {
  3. echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)"
  4. }
  5. _symfony2_get_command_list () {
  6. `_symfony_console` --no-ansi | sed "1,/Available commands/d" | awk '/^ ?[^ ]+ / { print $1 }'
  7. }
  8. _symfony2 () {
  9. compadd `_symfony2_get_command_list`
  10. }
  11. compdef _symfony2 '`_symfony_console`'
  12. compdef _symfony2 'app/console'
  13. compdef _symfony2 'bin/console'
  14. compdef _symfony2 sf
  15. #Alias
  16. alias sf='`_symfony_console`'
  17. alias sfcl='sf cache:clear'
  18. alias sfsr='sf server:run -vvv'
  19. alias sfcw='sf cache:warmup'
  20. alias sfroute='sf debug:router'
  21. alias sfcontainer='sf debug:container'
  22. alias sfgb='sf generate:bundle'
  23. alias sfdev='sf --env=dev'
  24. alias sfprod='sf --env=prod'