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