Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

MissingRequiredOptionError when specifying required Value after enumerable Options #91

Copy link
Copy link
@ericnewton76

Description

@ericnewton76
Issue body actions

Issue by SuperFXMaster
Tuesday Oct 11, 2016 at 19:24 GMT
Originally opened as gsscoder/commandline#361


The following options class:

public class CommandLineOptions
{
    [Value(0, Required = true)]
    public string InputFileName { get; set; }

    [Option('o', "output")]
    public string OutputFileName { get; set; }

    [Option('i', "include", Separator = ',')]
    public IEnumerable<string> Included { get; set; }

    [Option('e', "exclude", Separator = ',')]
    public IEnumerable<string> Excluded { get; set; }
}

When provided to the default parser, with the commandline app.exe --exclude=a,b InputFile.txt results in a MissingRequiredOptionError: A required value not bound to option name is missing. I expected the library to accept InputFileName = InputFile.txt and --exclude=a,b as Excluded = { "a", "b" }. Is there something else required to make this work as I expect, or is it a bug?

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.