_artisan 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #compdef artisan
  2. # Laravel autocompletion
  3. # Author: John Hamelink <john@johnhamelink.com>
  4. #
  5. # This plugin does the following:
  6. # - Adds aliases and autocompletion for artisan
  7. # - Adds aliases and autocompletion for bob
  8. local curcontext="$curcontext" state line _opts _bundles ret=1
  9. _arguments -C \
  10. '1: :->cmds' \
  11. '*:: :->args' && ret=0
  12. case $state in
  13. cmds)
  14. _values "Artisan command" \
  15. 'session\:install[Create a session table]' \
  16. 'migrate[Manage Migrations]' \
  17. 'test[Run a test]' \
  18. 'route\:\:call[Call a route in the CLI]' \
  19. 'key\:\:generate[Generate a key]'
  20. ret=0
  21. ;;
  22. args)
  23. case $line[1] in
  24. migrate)
  25. _values \
  26. 'install[Create the Laravel migration table' \
  27. 'make[Create a migration]' \
  28. 'rollback[Roll back to the last migration operation]' \
  29. 'reset[Roll back all migrations that have ever run]'
  30. ret=0
  31. ;;
  32. esac
  33. ;;
  34. esac
  35. return ret