Skip to content

Commit 839e1e7

Browse files
committed
fix #506
1 parent 2db5ead commit 839e1e7

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

src/System.CommandLine.Tests/Help/HelpBuilderTests.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,21 @@ public void Required_options_are_indicated_when_argument_is_named()
11061106
.Contain("-r, --required <ARG> (REQUIRED)");
11071107
}
11081108

1109+
[Fact]
1110+
public void Help_option_is_shown_in_help()
1111+
{
1112+
var parser = new CommandLineBuilder()
1113+
.UseHelp()
1114+
.Build();
1115+
1116+
_helpBuilder.Write(parser.Configuration.RootCommand);
1117+
1118+
var help = _console.Out.ToString();
1119+
1120+
help.Should()
1121+
.Contain($"--help{_columnPadding}Show help and usage information");
1122+
}
1123+
11091124
#endregion Options
11101125

11111126
#region Subcommands

src/System.CommandLine.Tests/VersionOptionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public async Task Version_option_appears_in_help()
6666
console.Out
6767
.ToString()
6868
.Should()
69-
.Match("*Options:*--version*Display version information*");
69+
.Match("*Options:*--version*Show version information*");
7070
}
7171

7272
[Fact]

src/System.CommandLine/Builder/CommandLineBuilderExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public static CommandLineBuilder UseHelp(this CommandLineBuilder builder)
275275
"--help",
276276
"-?",
277277
"/?"
278-
});
278+
}, "Show help and usage information");
279279

280280
return builder.UseHelp(helpOption);
281281
}
@@ -428,7 +428,7 @@ public static CommandLineBuilder UseVersionOption(
428428
return builder;
429429
}
430430

431-
var versionOption = new Option("--version", "Display version information");
431+
var versionOption = new Option("--version", "Show version information");
432432

433433
builder.AddOption(versionOption);
434434

0 commit comments

Comments
 (0)