Clara
Clara copied to clipboard
Parsing arguments with trailing garbage should fail
Integer arguments with trailing garbage are successfully decoded instead of giving an error:
42garbage
is decoded as 42 instead of parse error
This will be also a problem for other types. I looked at the implementation and the fix should be quite simple -- just checking if the stringstream is empty after the conversion.
Fixed in Lyra library with this change https://github.com/bfgroup/Lyra/commit/cdd5a924160402e7fb94736103e40cb64e0e27b1