n98-magerun.plugin.zsh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. # AUTHOR: Jisse Reitsma (jisse at yireo dot com)
  6. # VERSION: 1.1.0
  7. # ------------------------------------------------------------------------------
  8. # n98-magerun basic command completion
  9. _n98_magerun_get_command_list () {
  10. $_comp_command1 --no-ansi | sed "1,/Available commands/d" | awk '/^ +[a-z\-:]+/ { print $1 }'
  11. }
  12. _n98_magerun () {
  13. _arguments '1: :->command' '*:optional arg:_files'
  14. case $state in
  15. command)
  16. compadd $(_n98_magerun_get_command_list)
  17. ;;
  18. *)
  19. esac
  20. }
  21. compdef _n98_magerun n98-magerun.phar
  22. compdef _n98_magerun n98-magerun
  23. compdef _n98_magerun n98-magerun2.phar
  24. compdef _n98_magerun n98-magerun2
  25. # Aliases
  26. alias n98='n98-magerun.phar'
  27. alias mage='n98-magerun.phar'
  28. alias magerun='n98-magerun.phar'
  29. alias n98-2='n98-magerun2.phar'
  30. alias mage2='n98-magerun2.phar'
  31. alias magerun2='n98-magerun2.phar'
  32. # Install n98-magerun into the current directory
  33. alias mage-get='wget https://files.magerun.net/n98-magerun.phar'
  34. alias mage2-get='wget https://files.magerun.net/n98-magerun2.phar'