From edc449275b6c04445f58b108ca0937a87c1e8430 Mon Sep 17 00:00:00 2001 From: Aditya Date: Mon, 27 Feb 2023 20:04:56 +0530 Subject: add zsh --- oh-my-zsh/plugins/n98-magerun/README.md | 21 +++++++++++ .../plugins/n98-magerun/n98-magerun.plugin.zsh | 42 ++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 oh-my-zsh/plugins/n98-magerun/README.md create mode 100644 oh-my-zsh/plugins/n98-magerun/n98-magerun.plugin.zsh (limited to 'oh-my-zsh/plugins/n98-magerun') diff --git a/oh-my-zsh/plugins/n98-magerun/README.md b/oh-my-zsh/plugins/n98-magerun/README.md new file mode 100644 index 0000000..b0abe47 --- /dev/null +++ b/oh-my-zsh/plugins/n98-magerun/README.md @@ -0,0 +1,21 @@ +# n98-magerun plugin + +The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. + +The [n98-magerun plugin](https://github.com/netz98/n98-magerun) provides many +[useful aliases](#aliases) as well as completion for the `n98-magerun` command. + +Enable it by adding `n98-magerun` to the plugins array in your zshrc file: + +```zsh +plugins=(... n98-magerun) +``` + +## Aliases + +| Alias | Command | Description | +| --------- | -------------------------------------------------- | --------------------------------------------------------------------------------- | +| n98 | `n98-magerun.phar` | The N98-Magerun phar-file (Version 1) | +| n98-2 | `n98-magerun2.phar` | The N98-Magerun phar-file (Version 2) | +| mage-get | `wget https://files.magerun.net/n98-magerun.phar` | Download the latest stable N98-Magerun phar-file from the file-server (Version 1) | +| mage2-get | `wget https://files.magerun.net/n98-magerun2.phar` | Download the latest stable N98-Magerun phar-file from the file-server (Version 2) | diff --git a/oh-my-zsh/plugins/n98-magerun/n98-magerun.plugin.zsh b/oh-my-zsh/plugins/n98-magerun/n98-magerun.plugin.zsh new file mode 100644 index 0000000..d79aee7 --- /dev/null +++ b/oh-my-zsh/plugins/n98-magerun/n98-magerun.plugin.zsh @@ -0,0 +1,42 @@ +# ------------------------------------------------------------------------------ +# 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) +# AUTHOR: Jisse Reitsma (jisse at yireo dot com) +# VERSION: 1.1.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 + +# Aliases +alias n98='n98-magerun.phar' +alias mage='n98-magerun.phar' +alias magerun='n98-magerun.phar' + +alias n98-2='n98-magerun2.phar' +alias mage2='n98-magerun2.phar' +alias magerun2='n98-magerun2.phar' + +# Install n98-magerun into the current directory +alias mage-get='wget https://files.magerun.net/n98-magerun.phar' +alias mage2-get='wget https://files.magerun.net/n98-magerun2.phar' -- cgit v1.2.3