From 244410cda9eb44ef7b2467e58d64e49aaebfca46 Mon Sep 17 00:00:00 2001 From: open-trade Date: Tue, 30 Mar 2021 16:01:22 +0800 Subject: key --- src/hbbr.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/hbbr.rs') diff --git a/src/hbbr.rs b/src/hbbr.rs index e65b6ce..c2ac21b 100644 --- a/src/hbbr.rs +++ b/src/hbbr.rs @@ -7,7 +7,9 @@ use std::sync::{Arc, Mutex}; fn main() -> ResultType<()> { init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info")); let args = format!( - "-p, --port=[NUMBER(default={})] 'Sets the listening port'", + "-p, --port=[NUMBER(default={})] 'Sets the listening port' + -k, --key=[KEY] 'Only allow the client with the same key' + ", DEFAULT_PORT ); let matches = App::new("hbbr") @@ -17,6 +19,10 @@ fn main() -> ResultType<()> { .args_from_usage(&args) .get_matches(); let stop: Arc> = Default::default(); - start(matches.value_of("port").unwrap_or(DEFAULT_PORT), "", stop)?; + start( + matches.value_of("port").unwrap_or(DEFAULT_PORT), + matches.value_of("key").unwrap_or(""), + stop, + )?; Ok(()) } -- cgit v1.2.3