Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Help command header text incorrect voice, missing full stop #1579

Merged
merged 2 commits into from
Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ println "done"
" -h, --help Show this help message and exit.%n" +
" -V, --version Print version information and exit.%n" +
"Commands:%n" +
" help Displays help information about the specified command%n" +
" help Display help information about the specified command.%n" +
" commit Record changes to the repository"
assertEquals(String.format(expected), baos.toString().trim())
assertEquals(null, result)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/picocli/CommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -15009,7 +15009,7 @@ static class AutoHelpMixin {
* and a {@code COMMAND} positional parameter with {@code descriptionKey = "helpCommand.command"}.
* @since 3.0
*/
@Command(name = "help", header = "Displays help information about the specified command",
@Command(name = "help", header = "Display help information about the specified command.",
synopsisHeading = "%nUsage: ", helpCommand = true,
description = {"%nWhen no COMMAND is given, the usage help for the main command is displayed.",
"If a COMMAND is specified, the help for that command is shown.%n"})
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/picocli/AutoCompleteTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,7 @@ public void run() { }
" --apples=<apples>%n" +
" --bbb=<b>%n" +
"Commands:%n" +
" help Displays help information about the specified command%n");
" help Display help information about the specified command.%n");
assertEquals(expectedUsage, cmd.getUsageMessage(CommandLine.Help.Ansi.OFF));

StringWriter sw = new StringWriter();
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/picocli/Demo.java
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ public void testUsageMainCommand() {
"Commands:%n" +
"%n" +
"The most commonly used git commands are:%n" +
" help Displays help information about the specified command%n" +
" help Display help information about the specified command.%n" +
" status Show the working tree status.%n" +
" commit Record changes to the repository.%n" +
" add Add file contents to the index.%n" +
Expand All @@ -510,7 +510,7 @@ public void testUsageMainCommand() {
"Commands:%n" +
"%n" +
"The most commonly used git commands are:%n" +
" \u001B[1mhelp\u001B[21m\u001B[0m Displays help information about the specified command%n" +
" \u001B[1mhelp\u001B[21m\u001B[0m Display help information about the specified command.%n" +
" \u001B[1mstatus\u001B[21m\u001B[0m Show the working tree status.%n" +
" \u001B[1mcommit\u001B[21m\u001B[0m Record changes to the repository.%n" +
" \u001B[1madd\u001B[21m\u001B[0m Add file contents to the index.%n" +
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/picocli/HelpSubCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class App implements Runnable{ public void run(){}}
" -V, --version Print version information and exit.%n" +
"Commands:%n" +
" sub This is a subcommand%n" +
" help Displays help information about the specified command%n");
" help Display help information about the specified command.%n");
assertEquals(expected, sw.toString());
}

Expand All @@ -328,7 +328,7 @@ class App implements Runnable{ public void run(){}}
" -V, --version Print version information and exit.%n" +
"Commands:%n" +
" sub This is a subcommand%n" +
" help Displays help information about the specified command%n");
" help Display help information about the specified command.%n");
assertEquals(expected, sw.toString());
}

Expand All @@ -344,7 +344,7 @@ class App implements Runnable{ public void run(){}}
.execute("help", "-h");

String expected = String.format("" +
"Displays help information about the specified command%n" +
"Display help information about the specified command.%n" +
"%n" +
"Usage: <main class> help [-h] [COMMAND]%n" +
"%n" +
Expand Down Expand Up @@ -377,7 +377,7 @@ class App implements Runnable{ public void run(){}}
" -V, --version Print version information and exit.%n" +
"Commands:%n" +
" sub This is a subcommand%n" +
" help Displays help information about the specified command%n");
" help Display help information about the specified command.%n");
assertEquals(expected, sw.toString());

sw = new StringWriter();
Expand Down Expand Up @@ -408,7 +408,7 @@ public void testHelpSubcommandRunPrintsParentUsageIfParentSet() {
"Usage: parent [COMMAND]%n" +
"the parent command%n" +
"Commands:%n" +
" parent Displays help information about the specified command%n");
" parent Display help information about the specified command.%n");
assertEquals(expected, this.systemOutRule.getLog());
}

Expand All @@ -427,7 +427,7 @@ public void testHelpSubcommand2RunPrintsParentUsageIfParentSet() {
"Usage: parent [COMMAND]%n" +
"the parent command%n" +
"Commands:%n" +
" parent Displays help information about the specified command%n");
" parent Display help information about the specified command.%n");
assertEquals(expected, this.systemOutRule.getLog());
}

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/picocli/HelpTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3295,7 +3295,7 @@ public void testAutoHelpMixinUsageHelpSubcommandOnAppWithoutSubcommands() {
" -h, --help Show this help message and exit.%n" +
" -V, --version Print version information and exit.%n" +
"Commands:%n" +
" help Displays help information about the specified command%n");
" help Display help information about the specified command.%n");
assertEquals(expected, baos.toString());
}

Expand All @@ -3315,7 +3315,7 @@ class App implements Runnable{ public void run(){}}
" -h, --help Show this help message and exit.%n" +
" -V, --version Print version information and exit.%n" +
"Commands:%n" +
" help Displays help information about the specified command%n");
" help Display help information about the specified command.%n");
assertEquals(expected, sw.toString());
}

Expand Down Expand Up @@ -5118,7 +5118,7 @@ class MyTool {
String expected = String.format("" +
"Usage: <main class> [COMMAND]%n" +
"Commands:%n" +
" help Displays help information about the specified command%n");
" help Display help information about the specified command.%n");
String actual = new CommandLine(new MyTool()).getUsageMessage();
assertEquals(expected, actual);
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/picocli/InterpolatedModelTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class App {
"OPTION HEADING%n" +
" -x+ <x> option description%n" +
"SUBCOMMANDS HEADING%n" +
" help Displays help information about the specified command%n" +
" help Display help information about the specified command.%n" +
"FOOTER HEADING%n" +
"FOOTER 1%n" +
"and FOOTER 2%n");
Expand Down Expand Up @@ -138,7 +138,7 @@ class App {
"OPTION HEADING%n" +
" -x+ <x> option description%n" +
"SUBCOMMANDS HEADING%n" +
" help Displays help information about the specified command%n" +
" help Display help information about the specified command.%n" +
"FOOTER HEADING%n" +
"FOOTER 1%n" +
"and FOOTER 2%n");
Expand Down