Skip to content

Fix overriding HelpName in Parser.cs, set it explicitly instead #49423

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 @@ -10,13 +10,15 @@ public static class SharedOptions
public static Option<FileInfo> OutputOption { get; } = new("--output", "-o")
{
Description = SymbolStrings.Option_Output,
HelpName = SymbolStrings.Option_Output_HelpName,
Required = false,
Arity = new ArgumentArity(1, 1)
};

public static Option<FileInfo> ProjectPathOption { get; } = new Option<FileInfo>("--project")
{
Description = SymbolStrings.Option_ProjectPath
Description = SymbolStrings.Option_ProjectPath,
HelpName = SymbolStrings.Option_ProjectPath_HelpName
}.AcceptExistingOnly();

public static Option<bool> InteractiveOption { get; } = SharedOptionsFactory.CreateInteractiveOption();
Expand All @@ -26,6 +28,7 @@ public static class SharedOptions
internal static Option<string> NameOption { get; } = new("--name", "-n")
{
Description = SymbolStrings.TemplateCommand_Option_Name,
HelpName = SymbolStrings.TemplateCommand_Option_Name_HelpName,
Arity = new ArgumentArity(1, 1)
};

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,18 @@ If command is specified without the argument, it lists all the template packages
<data name="Option_Output" xml:space="preserve">
<value>Location to place the generated output.</value>
</data>
<data name="Option_Output_HelpName" xml:space="preserve">
<value>OUTPUT</value>
</data>
<data name="Option_PackageFilter" xml:space="preserve">
<value>Filters the templates based on NuGet package ID.</value>
</data>
<data name="Option_ProjectPath" xml:space="preserve">
<value>The project that should be used for context evaluation.</value>
</data>
<data name="Option_ProjectPath_HelpName" xml:space="preserve">
<value>PROJECT</value>
</data>
<data name="Option_TagFilter" xml:space="preserve">
<value>Filters the templates based on the tag.</value>
</data>
Expand All @@ -259,6 +265,9 @@ If command is specified without the argument, it lists all the template packages
<data name="TemplateCommand_Option_Name" xml:space="preserve">
<value>The name for the output being created. If no name is specified, the name of the output directory is used.</value>
</data>
<data name="TemplateCommand_Option_Name_HelpName" xml:space="preserve">
<value>NAME</value>
</data>
<data name="TemplateCommand_Option_NoUpdateCheck" xml:space="preserve">
<value>Disables checking for the template package updates when instantiating a template.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,6 @@ internal static void ShowCommandOptions(
}
}

foreach (Option cliOption in optionsToShow)
{
cliOption.EnsureHelpName();
}

context.Output.WriteLine(LocalizationResources.HelpOptionsTitle());
IEnumerable<TwoColumnHelpRow> optionsToWrite = optionsToShow.Select(o => context.HelpBuilder.GetTwoColumnRow(o, context));
context.HelpBuilder.WriteColumns(optionsToWrite.ToArray(), context);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading