symfony2.plugin.zsh 658 B

1234567891011121314151617181920212223242526
  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 '/^ ?[a-z]+/ { 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 sfcw='sf cache:warmup'
  19. alias sfroute='sf router:debug'
  20. alias sfcontainer='sf container:debug'
  21. alias sfgb='sf generate:bundle'