Skip to content

Commit e3c8aca

Browse files
authored
Switch the top level help item to be Description: rather than the name of the command which was inconsistent (#1335)
* Switch the top level help item to be Description: rather than the name of the command which was inconsistent * Update Tile to Title to match the other ones. * Fix the tests impacted by the new Description label
1 parent d2203f9 commit e3c8aca

19 files changed

+86
-5
lines changed

src/System.CommandLine.Tests/Help/Approvals/HelpBuilderTests.Help_describes_default_values_for_complex_root_command_scenario.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
the-root-command
1+
Description:
22
Test description
33

44
Usage:

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public void Synopsis_section_keeps_added_newlines()
5757
_helpBuilder.Write(command);
5858

5959
var expected =
60-
$"{_executableName}{NewLine}" +
6160
$"{_indentation}test{NewLine}" +
6261
$"{_indentation}{NewLine}" +
6362
$"{_indentation}description with{NewLine}" +
@@ -80,7 +79,6 @@ public void Synopsis_section_properly_wraps_description()
8079
helpBuilder.Write(command);
8180

8281
var expected =
83-
$@"{_executableName}{NewLine}" +
8482
$"{_indentation}test\tdescription with some tabs that is long enough to wrap to a\t{NewLine}" +
8583
$"{_indentation}new line{NewLine}{NewLine}";
8684

src/System.CommandLine/Help/HelpBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected internal void Customize(ISymbol symbol,
6262

6363
protected virtual void AddSynopsis(ICommand command)
6464
{
65-
WriteHeading(command.Name, command.Description);
65+
WriteHeading(Resources.Instance.HelpDescriptionTitle(), command.Description);
6666
Console.Out.WriteLine();
6767
}
6868

src/System.CommandLine/Properties/Resources.Designer.cs

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/System.CommandLine/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@
185185
</data>
186186
<data name="HelpUsageTitle" xml:space="preserve">
187187
<value>Usage:</value>
188+
</data>
189+
<data name="HelpDescriptionTitle" xml:space="preserve">
190+
<value>Description:</value>
188191
</data>
189192
<data name="HelpArgumentDefaultValueTitle" xml:space="preserve">
190193
<value>default</value>

src/System.CommandLine/Properties/xlf/Resources.cs.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ The value of the variable should be the name of the processes, separated by a se
106106
<target state="new">Commands:</target>
107107
<note />
108108
</trans-unit>
109+
<trans-unit id="HelpDescriptionTitle">
110+
<source>Description:</source>
111+
<target state="new">Description:</target>
112+
<note />
113+
</trans-unit>
109114
<trans-unit id="HelpOptionDescription">
110115
<source>Show help and usage information</source>
111116
<target state="new">Show help and usage information</target>

src/System.CommandLine/Properties/xlf/Resources.de.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ The value of the variable should be the name of the processes, separated by a se
106106
<target state="new">Commands:</target>
107107
<note />
108108
</trans-unit>
109+
<trans-unit id="HelpDescriptionTitle">
110+
<source>Description:</source>
111+
<target state="new">Description:</target>
112+
<note />
113+
</trans-unit>
109114
<trans-unit id="HelpOptionDescription">
110115
<source>Show help and usage information</source>
111116
<target state="new">Show help and usage information</target>

src/System.CommandLine/Properties/xlf/Resources.es.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ The value of the variable should be the name of the processes, separated by a se
106106
<target state="new">Commands:</target>
107107
<note />
108108
</trans-unit>
109+
<trans-unit id="HelpDescriptionTitle">
110+
<source>Description:</source>
111+
<target state="new">Description:</target>
112+
<note />
113+
</trans-unit>
109114
<trans-unit id="HelpOptionDescription">
110115
<source>Show help and usage information</source>
111116
<target state="new">Show help and usage information</target>

src/System.CommandLine/Properties/xlf/Resources.fr.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ The value of the variable should be the name of the processes, separated by a se
106106
<target state="new">Commands:</target>
107107
<note />
108108
</trans-unit>
109+
<trans-unit id="HelpDescriptionTitle">
110+
<source>Description:</source>
111+
<target state="new">Description:</target>
112+
<note />
113+
</trans-unit>
109114
<trans-unit id="HelpOptionDescription">
110115
<source>Show help and usage information</source>
111116
<target state="new">Show help and usage information</target>

src/System.CommandLine/Properties/xlf/Resources.it.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ The value of the variable should be the name of the processes, separated by a se
106106
<target state="new">Commands:</target>
107107
<note />
108108
</trans-unit>
109+
<trans-unit id="HelpDescriptionTitle">
110+
<source>Description:</source>
111+
<target state="new">Description:</target>
112+
<note />
113+
</trans-unit>
109114
<trans-unit id="HelpOptionDescription">
110115
<source>Show help and usage information</source>
111116
<target state="new">Show help and usage information</target>

0 commit comments

Comments
 (0)