We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following:
class MyOptions { public MyOptions(string foo) {Foo = foo;} [Option("foo", Required = false, Default = 42)] //note the integer default public string Foo {get;} }
Will result in:
System.ArgumentException: Object of type 'System.Int32' cannot be converted to type 'System.String'. at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast) at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr) at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at CommandLine.Core.InstanceBuilder.<>c__DisplayClass0_2`1.<Build>b__23() at CommandLine.Core.InstanceBuilder.<>c__DisplayClass0_0`1.<Build>b__7() at CommandLine.Core.InstanceBuilder.Build[T](Maybe`1 factory, Func`3 tokenizer, IEnumerable`1 arguments, StringComparer nameComparer, Boolean ignoreValueCase, CultureInfo parsingCulture, IEnumerable`1 nonFatalErrors) at CommandLine.Core.InstanceChooser.MatchVerb(Func`3 tokenizer, IEnumerable`1 verbs, IEnumerable`1 arguments, StringComparer nameComparer, CultureInfo parsingCulture, IEnumerable`1 nonFatalErrors) at CommandLine.Core.InstanceChooser.<>c__DisplayClass0_0.<Choose>b__0() at CommandLine.Core.InstanceChooser.Choose(Func`3 tokenizer, IEnumerable`1 types, IEnumerable`1 arguments, StringComparer nameComparer, CultureInfo parsingCulture, IEnumerable`1 nonFatalErrors) at CommandLine.Parser.ParseArguments(IEnumerable`1 args, Type[] types) at CommandLine.ParserExtensions.ParseArguments[T1,T2](Parser parser, IEnumerable`1 args) at CommandLineParserTest.Program.Main()
A more meaningful exception would go a long way to help debugging such issues.
The text was updated successfully, but these errors were encountered:
Proposed changes for enhancement:
7d29a60
commandlineparser#189
It's resolved in v2.5.0
Sorry, something went wrong.
No branches or pull requests
The following:
Will result in:
A more meaningful exception would go a long way to help debugging such issues.
The text was updated successfully, but these errors were encountered: