add --connect to cli

This commit is contained in:
rustdesk
2022-12-29 11:18:03 +08:00
parent 7dc0c07578
commit 6bf1710477
2 changed files with 28 additions and 2 deletions

View File

@@ -36,6 +36,7 @@ fn main() {
use hbb_common::log;
let args = format!(
"-p, --port-forward=[PORT-FORWARD-OPTIONS] 'Format: remote-id:local-port:remote-port[:remote-host]'
-c, --connect=[REMOTE_ID] 'test only'
-k, --key=[KEY] ''
-s, --server... 'Start server'",
);
@@ -83,6 +84,12 @@ fn main() {
key,
token,
);
} else if let Some(p) = matches.value_of("connect") {
common::test_rendezvous_server();
common::test_nat_type();
let key = matches.value_of("key").unwrap_or("").to_owned();
let token = LocalConfig::get_option("access_token");
cli::connect_test(p, key, token);
} else if let Some(p) = matches.value_of("server") {
crate::start_server(true);
}