shell-proxy.plugin.zsh 290 Bytes
Newer Older
Septs's avatar
Septs committed
1
2
3
4
5
6
#!/usr/bin/bash
# shellcheck disable=SC1090

__PROXY__="${0:A:h}/proxy.py"

proxy() {
7
	source <(env "DEFAULT_PROXY=$DEFAULT_PROXY" "$__PROXY__" "$1")
Septs's avatar
Septs committed
8
9
10
11
12
13
14
15
16
}

_proxy() {
	local -r commands=('enable' 'disable' 'status')
	compset -P '*,'
	compadd -S '' "${commands[@]}"
}

compdef '_proxy' 'proxy'