Cysharp / ConsoleAppFramework

Zero Dependency, Zero Overhead, Zero Reflection, Zero Allocation, AOT Safe CLI Framework powered by C# Source Generator.
MIT License
1.54k stars 88 forks source link

Improve grammar of exceptions #111

Closed xPaw closed 1 month ago

xPaw commented 1 month ago

I've noticed the value printed in ThrowArgumentParseFailed may not be correct in some cases, like when TryIncrementIndex fails, it will print the argument name itself, rather than the value (because there isn't one). Maybe this should be special cased to a new exception like Argument '{argumentName}' requires a value, but none was specified.?

neuecc commented 1 month ago

Thanks! I agree, while the current solution was a bit of a quick fix, it would be preferable to have a more thorough separation.