symfony2.plugin.zsh 690 B

123456789101112131415161718192021222324252627
  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 router:debug'
  21. alias sfcontainer='sf container:debug'
  22. alias sfgb='sf generate:bundle'