commandline icon indicating copy to clipboard operation
commandline copied to clipboard

Not meaningful error in case of options with same name

Open gsscoder opened this issue 2 years ago • 1 comments

Repro:

class Options {
    [Option('s', "storage", Required = true, HelpText = "Storage account name hosting metrics")]
    public string StorageName { get; set; }

    [Option('s', "key", Required = true, HelpText = "Key of given storage account")]
    public string StorageKey { get; set; }
}

Error given is: System.InvalidOperationException: 'Sequence contains more than one matching element

Suggested message: One of more options has the same name. Check attributes properties

Thanks :)

gsscoder avatar Jan 28 '23 16:01 gsscoder

Hey, is this issue still open for contributors ? I took a look at the code and I think I know the root cause and I want to take a shot at solving it so please LMK!

Abdallah-Darwish avatar May 28 '23 23:05 Abdallah-Darwish