Skip to content

Commit c9898d0

Browse files
committed
test(help): Verify short with value
1 parent df7bdfc commit c9898d0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/builder/help.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2416,6 +2416,29 @@ Options:
24162416
utils::assert_output(cmd, "demo -h", expected, false);
24172417
}
24182418

2419+
#[test]
2420+
fn short_with_value() {
2421+
let cmd = Command::new("demo").arg(
2422+
Arg::new("baz")
2423+
.short('z')
2424+
.value_name("BAZ")
2425+
.help("Short only")
2426+
.help_heading("Baz"),
2427+
);
2428+
2429+
let expected = str![[r#"
2430+
Usage: demo [OPTIONS]
2431+
2432+
Options:
2433+
-h, --help Print help
2434+
2435+
Baz:
2436+
-z <BAZ> Short only
2437+
2438+
"#]];
2439+
utils::assert_output(cmd, "demo -h", expected, false);
2440+
}
2441+
24192442
#[test]
24202443
fn issue_1487() {
24212444
let cmd = Command::new("test")

0 commit comments

Comments
 (0)