diff --git a/plugins/cartridge/README.md b/plugins/cartridge/README.md new file mode 100644 index 000000000..b62388eec --- /dev/null +++ b/plugins/cartridge/README.md @@ -0,0 +1,9 @@ +# Cartridge + +This plugin provides completion for Tarantool [cartridge](https://www.tarantool.io/en/cartridge/) commands. + +To use it add `cartridge` to the plugins array in your .zshrc file. + +```zsh +plugins=(... cartridge) +``` diff --git a/plugins/cartridge/cartridge.plugin.zsh b/plugins/cartridge/cartridge.plugin.zsh new file mode 100644 index 000000000..49a7af00a --- /dev/null +++ b/plugins/cartridge/cartridge.plugin.zsh @@ -0,0 +1,11 @@ + +# Cartridge basic commands +_cartridge_get_command_list () { + cartridge | sed "1,/Available Commands/d" | awk '/^[ \t]*[a-z]+/ { print $1 }' +} + +_cartridge () { + compadd `_cartridge_get_command_list` +} + +compdef _cartridge cartridge