n98-magerun.plugin.zsh 1018 B

12345678910111213141516171819202122232425262728293031323334
  1. # ------------------------------------------------------------------------------
  2. # FILE: n98-magerun.plugin.zsh
  3. # DESCRIPTION: oh-my-zsh n98-magerun plugin file. Adapted from composer plugin
  4. # AUTHOR: Andrew Dwyer (andrewrdwyer at gmail dot com)
  5. # VERSION: 1.0.0
  6. # ------------------------------------------------------------------------------
  7. # n98-magerun basic command completion
  8. _n98_magerun_get_command_list () {
  9. $_comp_command1 --no-ansi | sed "1,/Available commands/d" | awk '/^ +[a-z\-:]+/ { print $1 }'
  10. }
  11. _n98_magerun () {
  12. _arguments '1: :->command' '*:optional arg:_files'
  13. case $state in
  14. command)
  15. compadd $(_n98_magerun_get_command_list)
  16. ;;
  17. *)
  18. esac
  19. }
  20. compdef _n98_magerun n98-magerun.phar
  21. compdef _n98_magerun n98-magerun
  22. # Aliases
  23. alias n98='n98-magerun.phar'
  24. alias mage='n98-magerun.phar'
  25. alias magefl='n98-magerun.phar cache:flush'
  26. # Install n98-magerun into the current directory
  27. alias mage-get='wget https://raw.github.com/netz98/n98-magerun/master/n98-magerun.phar'