From f75d704e58d00d3d5b80e5d92f5ad79b27089540 Mon Sep 17 00:00:00 2001 From: zephyr Date: Wed, 27 Apr 2022 20:57:55 +0900 Subject: [PATCH] beautify display of configuration when starting up --- Cargo.lock | 10 +++++----- cmd/Cargo.toml | 4 ++-- cmd/src/client.rs | 11 +++++++++-- cmd/src/server.rs | 11 +++++++++-- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6272f0f..9d603fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -114,9 +114,7 @@ dependencies = [ [[package]] name = "kaminari" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e61016796e12b5c49fae513e18b92b6cd722f6ad5b0f2c65efbf6fb7b98897a7" +version = "0.7.1" dependencies = [ "lazy_static", "lightws", @@ -130,6 +128,8 @@ dependencies = [ [[package]] name = "kaminari" version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdcb3bad5f8c686e300ab60a738f1294c20de0f45aeba8e4fd39dcaab7fb41e2" dependencies = [ "lazy_static", "lightws", @@ -142,10 +142,10 @@ dependencies = [ [[package]] name = "kaminari-cmd" -version = "0.5.0" +version = "0.5.1" dependencies = [ "anyhow", - "kaminari 0.7.0", + "kaminari 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "realm_io", "tokio", ] diff --git a/cmd/Cargo.toml b/cmd/Cargo.toml index 8167856..d72dae0 100644 --- a/cmd/Cargo.toml +++ b/cmd/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kaminari-cmd" -version = "0.5.0" +version = "0.5.1" edition = "2021" authors = ["zephyr "] repository = "https://github.com/zephyrchien/kaminari/cmd" @@ -9,7 +9,7 @@ readme = "README.md" license = "GPL-3.0" [dependencies] -kaminari = "0.7.0" +kaminari = "0.7.1" realm_io = "0.2.1" tokio = { version = "1", features = ["rt", "net", "macros"] } anyhow = "1" diff --git a/cmd/src/client.rs b/cmd/src/client.rs index 63980a2..5a45838 100644 --- a/cmd/src/client.rs +++ b/cmd/src/client.rs @@ -22,13 +22,20 @@ async fn main() -> Result<()> { eprintln!("listen: {}", &local); eprintln!("remote: {}", &remote); - eprintln!("ws: {:?}", &ws); - eprintln!("tls: {:?}", &tls); + + if let Some(ws) = &ws { + eprintln!("ws: {}", ws) + } + + if let Some(tls) = &tls { + eprintln!("tls: {}", &tls); + } let lis = TcpListener::bind(local).await?; macro_rules! run { ($cc: expr) => { + println!("connect: {}", $cc.as_ref()); loop { match lis.accept().await { Ok((stream, _)) => { diff --git a/cmd/src/server.rs b/cmd/src/server.rs index 53d0e25..f31da56 100644 --- a/cmd/src/server.rs +++ b/cmd/src/server.rs @@ -32,13 +32,20 @@ async fn main() -> Result<()> { eprintln!("listen: {}", &local); eprintln!("remote: {}", &remote); - eprintln!("ws: {:?}", &ws); - eprintln!("tls: {:?}", &tls); + + if let Some(ws) = &ws { + eprintln!("ws: {}", ws) + } + + if let Some(tls) = &tls { + eprintln!("tls: {}", &tls); + } let lis = TcpListener::bind(local).await?; macro_rules! run { ($ac: expr) => { + println!("accept: {}", $ac.as_ref()); loop { match lis.accept().await { Ok((stream, _)) => {