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 #482

Open
lucaghersi opened this issue Sep 19, 2017 · 0 comments
Open

Verb fails if option has no long name #482

lucaghersi opened this issue Sep 19, 2017 · 0 comments

Comments

@lucaghersi
Copy link

lucaghersi commented Sep 19, 2017

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 lucaghersi changed the title Verb "help" fails if option has no long name Verb fails if option has no long name Sep 19, 2017
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

1 participant