Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verb fails if option has no long name #169

Closed
ericnewton76 opened this issue Nov 4, 2017 · 0 comments
Closed

Verb fails if option has no long name #169

ericnewton76 opened this issue Nov 4, 2017 · 0 comments

Comments

@ericnewton76
Copy link
Member

Issue by lucaghersi
Tuesday Sep 19, 2017 at 15:32 GMT
Originally opened as gsscoder/commandline#482


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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants