Skip to content

AddEnumValuesToHelpText does not work for nullable enums #395

@peetw

Description

@peetw

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions