Skip to content

Conflict between short option and long option - always picks short option #58

Open
@samjudson

Description

@samjudson

Hi

I've got two options setup, one of which has a short code, which matches the first letter of the other long option.

bool option1Matched = false;
bool option2Matched = false;

p.Setup<string>('t', "option1").Callback(t => option1Matched = true);
p.Setup<string>("test2").Callback(t => option2Matched = true);

p.Parse(new[] {"-test2","value"});

Assert.IsFalse(option1Matched, "option1Matched should be false");
Assert.IsTrue(option2Matched, "option2Matched should be true");

The option passed in is "test2" but the "t" setup option is being called. Surely in this instance the most exact match (the second "test2" option) should be matched?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions