commandline icon indicating copy to clipboard operation
commandline copied to clipboard

Verb fails if option has no long name

Open lucaghersi opened this issue 8 years ago • 0 comments

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"

lucaghersi avatar Sep 19 '17 15:09 lucaghersi