ohmyzsh/plugins/n98-magerun/n98-magerun.plugin.zsh
Timon de Groot d3180f83c5 Add support n98-magerun2 to n98-magerun plugin
- Tweak the n98-magerun aliases a little bit as well
2016-11-18 20:01:18 +01:00

43 lines
1.2 KiB
Bash
Executable file

# ------------------------------------------------------------------------------
# FILE: n98-magerun.plugin.zsh
# DESCRIPTION: oh-my-zsh n98-magerun plugin file. Adapted from composer plugin
# AUTHOR: Andrew Dwyer (andrewrdwyer at gmail dot com)
# VERSION: 1.0.0
# ------------------------------------------------------------------------------
# n98-magerun basic command completion
_n98_magerun_get_command_list () {
$_comp_command1 --no-ansi | sed "1,/Available commands/d" | awk '/^ +[a-z\-:]+/ { print $1 }'
}
_n98_magerun () {
_arguments '1: :->command' '*:optional arg:_files'
case $state in
command)
compadd $(_n98_magerun_get_command_list)
;;
*)
esac
}
compdef _n98_magerun n98-magerun.phar
compdef _n98_magerun n98-magerun
compdef _n98_magerun n98-magerun2.phar
compdef _n98_magerun n98-magerun2
if type "n98-magerun.phar" > /dev/null; then
alias n98='n98-magerun.phar'
alias mage='n98-magerun.phar'
else
alias n98='n98-magerun'
alias mage='n98-magerun'
fi
# Aliases
alias magefl='n98 cache:flush'
# Install n98-magerun into the current directory
alias mage-get='wget https://raw.github.com/netz98/n98-magerun/master/n98-magerun.phar'