This commit is contained in:
open-trade
2021-03-30 16:01:22 +08:00
parent 457c74d203
commit 244410cda9
2 changed files with 17 additions and 27 deletions

View File

@@ -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<Mutex<bool>> = 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(())
}