diff --git a/vnt-cli/src/config/mod.rs b/vnt-cli/src/config/mod.rs index 8b4d9f0..d43ace2 100644 --- a/vnt-cli/src/config/mod.rs +++ b/vnt-cli/src/config/mod.rs @@ -177,11 +177,9 @@ pub fn get_device_id() -> String { } else { let id = uuid::Uuid::new_v4().to_string(); let path_buf = match crate::app_home() { - Ok(path_buf) => { - path_buf.join("device-id") - } + Ok(path_buf) => path_buf.join("device-id"), Err(e) => { - log::warn!("{:?}",e); + log::warn!("{:?}", e); return id; } }; diff --git a/vnt-cli/src/main.rs b/vnt-cli/src/main.rs index 923832b..ece118d 100644 --- a/vnt-cli/src/main.rs +++ b/vnt-cli/src/main.rs @@ -19,7 +19,11 @@ mod root_check; pub fn app_home() -> io::Result { let path = std::env::current_exe()? - .parent().ok_or(io::Error::new(io::ErrorKind::Other,"current_exe parent error"))? + .parent() + .ok_or(io::Error::new( + io::ErrorKind::Other, + "current_exe parent error", + ))? .join("env"); if !path.exists() { std::fs::create_dir_all(&path)?; @@ -56,7 +60,12 @@ fn main() { opts.optflag("", "cmd", "开启窗口输入"); opts.optflag("", "no-proxy", "关闭内置代理"); opts.optflag("", "first-latency", "优先延迟"); - opts.optflag("", "use-channel", "使用通道 relay/p2p,默认两者都使用"); + opts.optopt( + "", + "use-channel", + "使用通道 relay/p2p,默认两者都使用", + "", + ); opts.optopt("f", "", "配置文件", ""); //"后台运行时,查看其他设备列表" opts.optflag("", "list", "后台运行时,查看其他设备列表"); @@ -261,6 +270,7 @@ fn main() { .opt_get::("use-channel") .unwrap() .unwrap_or_else(|| { + println!("use_channel_type 111 {:?}", UseChannelType::All); if relay { UseChannelType::Relay } else {