diff --git a/README.md b/README.md index bd5ab52..4b93fcc 100644 --- a/README.md +++ b/README.md @@ -68,11 +68,12 @@ Tunnel interface to proxy. Usage: tun2proxy [OPTIONS] --proxy Options: - -t, --tun Name of the tun interface [default: tun0] - -p, --proxy Proxy URL in the form proto://[username[:password]@]host:port - -d, --dns DNS handling [default: virtual] [possible values: virtual, none] - -h, --help Print help - -V, --version Print version + -t, --tun Name of the tun interface [default: tun0] + -p, --proxy Proxy URL in the form proto://[username[:password]@]host:port + -d, --dns DNS handling [default: virtual] [possible values: virtual, none] + -s, --setup Routing and system setup [possible values: auto] + -h, --help Print help + -V, --version Print version ``` Currently, tun2proxy supports HTTP, SOCKS4/SOCKS4a and SOCKS5. A proxy is supplied to the `--proxy` argument in the URL format. For example, an HTTP proxy at `1.2.3.4:3128` with a username of `john.doe` and a password of `secret` is diff --git a/src/main.rs b/src/main.rs index 38cbe22..dfe3245 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,9 +28,9 @@ struct Args { )] dns: ArgDns, - /// Setup + /// Routing and system setup #[arg(short, long, value_name = "method", value_enum)] - setup: ArgSetup, + setup: Option, } #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, clap::ValueEnum)] @@ -59,7 +59,7 @@ fn main() -> ExitCode { } let mut setup: Setup; - if args.setup == ArgSetup::Auto { + if args.setup == Some(ArgSetup::Auto) { setup = Setup::new(&args.tun, &args.proxy.addr.ip(), get_default_cidrs()); if let Err(e) = setup.setup() { log::error!("{e}");