# shellcheck shell=dash

# TODO: rollback ...

___x_cmd_proxy_unset(){
    [ $# -gt 0 ] || set - --everything
    
    while [ "$#" -gt 0 ]; do
        case "$1" in
            -h|--help)          ___x_cmd help -m proxy unset; return ;;

            --http|http)        proxy:info "UNSET http_proxy HTTP_PROXY"
            	                unset http_proxy  ;     unset HTTP_PROXY    ;;

            --https|https)      proxy:info "UNSET https_proxy HTTPS_PROXY"
            	                unset https_proxy ;     unset HTTPS_PROXY   ;;

            --ftp|ftp)          proxy:info "UNSET ftp_proxy FTP_PROXY"
            	                unset ftp_proxy   ;     unset FTP_PROXY     ;;

            --all|all)          proxy:info "UNSET all_proxy ALL_PROXY"
            	                unset all_proxy   ;    unset ALL_PROXY      ;;

            -e|--everything)    ___x_cmd_proxy_unset http https ftp all     ;;
            
            *)                  N=proxy M="Unexpected argument=$1" log:ret:64
        esac
        
        shift
    done

    ___x_cmd_proxy___xbinexp
}
