Skip to content

Commit

Permalink
test(help): Show bad subcommand wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jul 31, 2024
1 parent e1f6320 commit 58b5bd8
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions tests/builder/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,20 @@ fn wrapped_help() {
.long("no-git-push")
.action(ArgAction::SetTrue)
.help("Do not push generated commit and tags to git remote"),
)
.subcommand(
Command::new("sub1")
.about("One two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen")
);

let expected = str![[r#"
Usage: test [OPTIONS]
Usage: test [OPTIONS] [COMMAND]
Commands:
sub1 One two three four five six seven eight nine ten eleven
twelve thirteen fourteen fifteen
help Print this message or the help of the given
subcommand(s)
Options:
-a, --all Also do versioning for private crates (will
Expand Down Expand Up @@ -614,10 +624,20 @@ fn unwrapped_help() {
.long("no-git-push")
.action(ArgAction::SetTrue)
.help("Do not push generated commit and tags to git remote"),
)
.subcommand(
Command::new("sub1")
.about("One two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen")
);

let expected = str![[r#"
Usage: test [OPTIONS]
Usage: test [OPTIONS] [COMMAND]
Commands:
sub1 One two three four five six seven eight nine ten eleven
twelve thirteen fourteen fifteen
help Print this message or the help of the given
subcommand(s)
Options:
-a, --all Also do versioning for private crates (will
Expand Down

0 comments on commit 58b5bd8

Please sign in to comment.