feat(cli): improve cli help text and unit test naming

This commit is contained in:
Nils Andreas Svee committed 2026-05-10 20:56:43 +07:00
1 parent 2a11e77cfd
commit 9e9b2d641f
1 file changed
+5 -3
+5 -3
View File
@@ -60,7 +60,7 @@ pub struct CliArgs {
#[arg(long = "stats", value_enum, default_value_t = ReceivedStatsArg::Both)] #[arg(long = "stats", value_enum, default_value_t = ReceivedStatsArg::Both)]
pub stats: ReceivedStatsArg, pub stats: ReceivedStatsArg,
/// Server payload fill string to request. /// Server payload fill string to request, up to 32 bytes.
#[arg( #[arg(
long = "sfill", long = "sfill",
visible_alias = "server-fill", visible_alias = "server-fill",
@@ -73,7 +73,7 @@ pub struct CliArgs {
#[arg(long, default_value_t = 0, value_name = "0..=63", value_parser = parse_dscp)] #[arg(long, default_value_t = 0, value_name = "0..=63", value_parser = parse_dscp)]
pub dscp: u8, pub dscp: u8,
/// Outgoing IPv4 TTL or IPv6 unicast hop limit. /// Local outgoing IPv4 TTL or IPv6 unicast hop limit; not negotiated.
#[arg(long, value_name = "1..=255", value_parser = parse_ttl)] #[arg(long, value_name = "1..=255", value_parser = parse_ttl)]
pub ttl: Option<u32>, pub ttl: Option<u32>,
@@ -835,7 +835,7 @@ mod tests {
} }
#[test] #[test]
fn maps_server_fill_options() { fn maps_sfill_server_fill_options() {
let args = parse(&["--sfill", "abc", "127.0.0.1:2112"]).unwrap(); let args = parse(&["--sfill", "abc", "127.0.0.1:2112"]).unwrap();
assert_eq!(args.to_client_config().server_fill.as_deref(), Some("abc")); assert_eq!(args.to_client_config().server_fill.as_deref(), Some("abc"));
@@ -902,6 +902,8 @@ mod tests {
assert!(help.contains("--ttl <1..=255>")); assert!(help.contains("--ttl <1..=255>"));
assert!(help.contains("--loose")); assert!(help.contains("--loose"));
assert!(help.contains("DSCP codepoint")); assert!(help.contains("DSCP codepoint"));
assert!(help.contains("up to 32 bytes"));
assert!(help.contains("not negotiated"));
} }
#[test] #[test]