Closed
Description
Issue by EmmaZhu
Tuesday Feb 28, 2017 at 07:20 GMT
Originally opened as gsscoder/commandline#417
For example, I have a customized parameter defined like following:
public class MyParameters
{
public MyParameters(string init)
{
throw new InvalidOperationException("Some error message");
}
public string Value { get; private set; }
}
I'd want to show the accurate error message when the parameter value user input is incorrect. But seems the error message is always like:
Option 'option1' is defined with a bad format.
Is there anyway I can get the error message passed through?
Metadata
Metadata
Assignees
Labels
No labels
Activity
ericnewton76 commentedon Nov 4, 2017
Saturday Mar 04, 2017 at 06:15 GMT
Can you post a minimal reproduction of the issue, with a complete options class and the args array you're passing to the compiler? Also, which version of the library are you using?
From what you've mentioned so far, and assuming you're using the version in
master, I think you will need to insert your custom error text when building the help screen:You can do whatever you want in the first delegate to
AutoBuild, including displaying custom messages.