From 5ea25e6736430ab5b8439d11b2e9a837a803771b Mon Sep 17 00:00:00 2001 From: Septs Date: Mon, 25 May 2020 00:48:43 +0800 Subject: Add `shell-proxy` plugin (#8692) --- plugins/shell-proxy/shell-proxy.plugin.zsh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 plugins/shell-proxy/shell-proxy.plugin.zsh (limited to 'plugins/shell-proxy/shell-proxy.plugin.zsh') diff --git a/plugins/shell-proxy/shell-proxy.plugin.zsh b/plugins/shell-proxy/shell-proxy.plugin.zsh new file mode 100644 index 000000000..fd0e2fe79 --- /dev/null +++ b/plugins/shell-proxy/shell-proxy.plugin.zsh @@ -0,0 +1,16 @@ +#!/usr/bin/bash +# shellcheck disable=SC1090 + +__PROXY__="${0:A:h}/proxy.py" + +proxy() { + source <("$__PROXY__" "$1") +} + +_proxy() { + local -r commands=('enable' 'disable' 'status') + compset -P '*,' + compadd -S '' "${commands[@]}" +} + +compdef '_proxy' 'proxy' -- cgit v1.2.3-70-g09d2