-
Notifications
You must be signed in to change notification settings - Fork 103
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
Better Message
#141
Comments
Is the |
Here https://github.com/AndrewSav/CommandLineParserPoc/blob/ca154fec085b96966d5cd45373270bef1b40536c/CommandLineParserPoC/CommandLineParser.cs#L178 I want to do something like this:
Does this make sense? |
Happy New Year @AndrewSav :-) Thinking about this some more - seems reasonable to me 👍 |
I think this one did not work out, but a different solution might be required depending on how #142 pans out. I was considering here a scenario with using
does not work with the proposed change, it cannot work:
it will not get to our error message if it does have a value and returns before that. The intention was to display the value the previous As a workaround, the existent functionality probably suffice like this:
That would produce Now if we only could also solve #142, the entire thing would be sorted out. I will close this for now. To recap the scenario I'm trying to work out: a token only has 4 ways to be parsed: Binary Switch, Value Switch, List Switch and Value (source that might explain that better), we do not expect Value at certain stages during the parsing, and we want to detect this situation early to give a good error message. Current we are getting the error message "AtEnd" when parser has failed to progress for any of the switches. |
@nblumhardt happy, ehm...., Queen's Birthday? ;) |
I would like an overload for
Message
for bothTextParser
andTokenListParser
that looks like this:That would allow me to use information in the result object for constructing the error message. This will be especially useful since the error message presence overrides expectations, and sometimes they are something that I would like to include into the resulting error message.
Will you consider accepting such a PR?
The text was updated successfully, but these errors were encountered: