Skip to content

AddEnumValuesToHelpText does not work for nullable enums #104

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

Closed
ericnewton76 opened this issue Nov 4, 2017 · 2 comments
Closed

AddEnumValuesToHelpText does not work for nullable enums #104

ericnewton76 opened this issue Nov 4, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@ericnewton76
Copy link
Member

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?

@dybalabj
Copy link

I'm having the same issue. Are there any plans to address this?

@moh-hassan moh-hassan added the bug label May 20, 2019
@moh-hassan moh-hassan added this to the 2.6 milestone May 20, 2019
@moh-hassan moh-hassan self-assigned this May 20, 2019
@moh-hassan
Copy link
Collaborator

Can you try the nuget package in Appveyor ci for test CommandLineParser.2.6.0-93-Dev.nupkg

moh-hassan added a commit that referenced this issue Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants