Skip to content

Verb fails if option has no long name #482

Open
@lucaghersi

Description

@lucaghersi

Using the verbs I noticed that the verb commmand fails with a System.ArgumentNullException if the long name for an option is not set. If you set the long name everything works fine.

So, if you use an option like this

[Option('v', null, HelpText = "Print details during execution.")]
public bool Verbose { get; set; }

you get this:

Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: longName
at CommandLine.OptionAttribute..ctor(String shortName, String longName)
at CommandLine.OptionAttribute..ctor(Char shortName, String longName)

calling "program VERBNAME" or "program help VERBNAME"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions