Skip to content

AddEnumValuesToHelpText does not work for nullable enums #395

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
peetw opened this issue Jan 12, 2017 · 0 comments
Open

AddEnumValuesToHelpText does not work for nullable enums #395

peetw opened this issue Jan 12, 2017 · 0 comments

Comments

@peetw
Copy link

peetw commented Jan 12, 2017

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant