Skip to content

AddEnumValuesToHelpText does not work for nullable enums #104

@ericnewton76

Description

@ericnewton76

Issue by peetw
Thursday Jan 12, 2017 at 08:45 GMT
Originally opened as gsscoder/commandline#395


When outputting HelpText, the following code will correctly list valid values for enum type options. However, if the option is a nullable enum type, then it will not list the valid values.

parserResult.WithNotParsed(errors =>
{
    // Use custom help text to ensure valid enum values are displayed
    var helpText = HelpText.AutoBuild(parserResult);
    helpText.AddEnumValuesToHelpText = true;
    helpText.AddOptions(parserResult);
    Console.Error.Write(helpText);
    Environment.Exit(1);
});

Is this a bug, or is there another setting/workaround for nullable enums?

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions