From 6ad47c0738475099072b5d00b405d0d0aceaa4df Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sun, 6 Aug 2023 15:39:23 +0200 Subject: [PATCH 1/3] use `action` to set value of the booleans - fix documentation --- benches/netbench/src/config.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/benches/netbench/src/config.rs b/benches/netbench/src/config.rs index 1b73085d4..6a71b2c91 100644 --- a/benches/netbench/src/config.rs +++ b/benches/netbench/src/config.rs @@ -35,22 +35,23 @@ pub struct Config { #[arg( long = "nodelay", short = 'd', - default_value_t = true, - help = "sets TCP in no-delay mode. Any int > 0 for true, 0 for false" + action, + help = "sets TCP in no-delay mode" )] pub no_delay: bool, #[arg( long = "nonblocking", short = 'b', - default_value_t = true, - help = "sets TCP in non-blocking mode. Any int > 0 for true, 0 for false" + action, + help = "sets TCP in non-blocking mode" )] pub non_blocking: bool, #[arg( - long = "thread", - short = 't', - help = "id of process to pin thread to, -1 for no pinning" - )] + long = "thread", + short = 't', + default_value_t = -1, + help = "id of process to pin thread to, -1 for no pinning" + )] pub p_id: i8, } From d7fd2a754398ff67690e90a552d25ad994f9908a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Mon, 7 Aug 2023 16:07:09 +0200 Subject: [PATCH 2/3] netbench: Clap: Remove `action` --- benches/netbench/src/config.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/benches/netbench/src/config.rs b/benches/netbench/src/config.rs index 6a71b2c91..6b8c1e74e 100644 --- a/benches/netbench/src/config.rs +++ b/benches/netbench/src/config.rs @@ -35,14 +35,12 @@ pub struct Config { #[arg( long = "nodelay", short = 'd', - action, help = "sets TCP in no-delay mode" )] pub no_delay: bool, #[arg( long = "nonblocking", short = 'b', - action, help = "sets TCP in non-blocking mode" )] pub non_blocking: bool, From 1279da1ad23fdc5d2681e418265e6589eb3dab5c Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Mon, 7 Aug 2023 16:17:49 +0200 Subject: [PATCH 3/3] minor changes to pass the format check --- benches/netbench/src/config.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/benches/netbench/src/config.rs b/benches/netbench/src/config.rs index 6b8c1e74e..16436e977 100644 --- a/benches/netbench/src/config.rs +++ b/benches/netbench/src/config.rs @@ -32,11 +32,7 @@ pub struct Config { help = "number of rounds of transfer to perform" )] pub n_rounds: usize, - #[arg( - long = "nodelay", - short = 'd', - help = "sets TCP in no-delay mode" - )] + #[arg(long = "nodelay", short = 'd', help = "sets TCP in no-delay mode")] pub no_delay: bool, #[arg( long = "nonblocking",