shell-proxy.plugin.zsh 290 B

12345678910111213141516
  1. #!/usr/bin/bash
  2. # shellcheck disable=SC1090
  3. __PROXY__="${0:A:h}/proxy.py"
  4. proxy() {
  5. source <(env "DEFAULT_PROXY=$DEFAULT_PROXY" "$__PROXY__" "$1")
  6. }
  7. _proxy() {
  8. local -r commands=('enable' 'disable' 'status')
  9. compset -P '*,'
  10. compadd -S '' "${commands[@]}"
  11. }
  12. compdef '_proxy' 'proxy'