symfony2.plugin.zsh 949 B

1234567891011121314151617181920212223242526272829303132333435
  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 --no-debug | 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 sfgc='sf generate:controller'
  24. alias sfgcom='sf generate:command'
  25. alias sfge='sf doctrine:generate:entity'
  26. alias sfsu='sf doctrine:schema:update'
  27. alias sfdc='sf doctrine:database:create'
  28. alias sfdev='sf --env=dev'
  29. alias sfprod='sf --env=prod'