n98-magerun.plugin.zsh 1.24 KB
Newer Older
1
2
3
4
# ------------------------------------------------------------------------------
# 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)
5
6
# AUTHOR: Jisse Reitsma (jisse at yireo dot com)
# VERSION: 1.1.0
7
8
9
10
# ------------------------------------------------------------------------------

# n98-magerun basic command completion
_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
17
18
19
20
21
22
23
  _arguments '1: :->command' '*:optional arg:_files'

  case $state in
    command)
      compadd $(_n98_magerun_get_command_list)
      ;;
    *)
  esac
24
25
26
}

compdef _n98_magerun n98-magerun.phar
27
compdef _n98_magerun n98-magerun
28
29
compdef _n98_magerun n98-magerun2.phar
compdef _n98_magerun n98-magerun2
30
31

# Aliases
32
alias n98='n98-magerun.phar'
33
alias mage='n98-magerun.phar'
34
35
36
37
38
alias magerun='n98-magerun.phar'

alias n98-2='n98-magerun2.phar'
alias mage2='n98-magerun2.phar'
alias magerun2='n98-magerun2.phar'
39
40

# Install n98-magerun into the current directory
41
42
alias mage-get='wget https://files.magerun.net/n98-magerun.phar'
alias mage2-get='wget https://files.magerun.net/n98-magerun2.phar'