style: change style
This commit is contained in:
21
src/main.rs
21
src/main.rs
@@ -27,29 +27,24 @@ fn main() {
|
||||
let program = args[0].clone();
|
||||
|
||||
let mut opts = Options::new();
|
||||
opts.reqopt("l",
|
||||
"local-port",
|
||||
opts.reqopt("l", "local-port",
|
||||
"The local port to which udpproxy should bind to",
|
||||
"LOCAL_PORT");
|
||||
opts.reqopt("r",
|
||||
"remote-port",
|
||||
opts.reqopt("r", "remote-port",
|
||||
"The remote port to which UDP packets should be forwarded",
|
||||
"REMOTE_PORT");
|
||||
opts.reqopt("h",
|
||||
"host",
|
||||
opts.reqopt("h", "host",
|
||||
"The remote address to which packets will be forwarded",
|
||||
"REMOTE_ADDR");
|
||||
opts.optopt("b",
|
||||
"bind",
|
||||
opts.optopt("b", "bind",
|
||||
"The address on which to listen for incoming requests",
|
||||
"BIND_ADDR");
|
||||
opts.optflag("d", "debug", "Enable debug mode");
|
||||
|
||||
let matches = opts.parse(&args[1..])
|
||||
.unwrap_or_else(|_| {
|
||||
print_usage(&program, opts);
|
||||
std::process::exit(-1);
|
||||
});
|
||||
let matches = opts.parse(&args[1..]).unwrap_or_else(|_| {
|
||||
print_usage(&program, opts);
|
||||
std::process::exit(-1);
|
||||
});
|
||||
|
||||
let local_port: i32 = matches.opt_str("l").unwrap().parse().unwrap();
|
||||
let remote_port: i32 = matches.opt_str("r").unwrap().parse().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user