symfony2.plugin.zsh 919 B

1234567891011121314151617181920212223
  1. # Symfony2 basic command completion
  2. _symfony2_get_command_list () {
  3. php $(find . -maxdepth 2 -mindepth 1 -name 'console') --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
  4. }
  5. _symfony2 () {
  6. if [ -f $(find . -maxdepth 2 -mindepth 1 -name 'console') ]; then
  7. compadd `_symfony2_get_command_list`
  8. fi
  9. }
  10. compdef _symfony2 $(find . -maxdepth 2 -mindepth 1 -name 'console')
  11. compdef _symfony2 sf
  12. #Alias
  13. alias sf='php $(find . -maxdepth 2 -mindepth 1 -name 'console') '
  14. alias sfcl='php $(find . -maxdepth 2 -mindepth 1 -name 'console') cache:clear'
  15. alias sfcw='php $(find . -maxdepth 2 -mindepth 1 -name 'console') cache:warmup'
  16. alias sfroute='php $(find . -maxdepth 2 -mindepth 1 -name 'console') router:debug'
  17. alias sfcontainer='php $(find . -maxdepth 2 -mindepth 1 -name 'console') container:debug'
  18. alias sfgb='php $(find . -maxdepth 2 -mindepth 1 -name 'console') generate:bundle'