Describe the bug
CLI parameters which are intended to accept numerical values (including those which take on optional suffix to denote the magnitude of the value) do not check that the values passed are well-formed.
To reproduce
For example, try running the lastest version of zstd as shown below:
zstd --memory=32LB file.txt
Expected behavior
I expected for zstd to reject the value passed for --memory since "LB" isn't a meaningful unit (perhaps the user made a typo and intended to say "KB"). This issue extends to even further malformed inputs, for instance the below example is also accepted without raising an error:
zstd --memory=hello file.txt
Describe the bug
CLI parameters which are intended to accept numerical values (including those which take on optional suffix to denote the magnitude of the value) do not check that the values passed are well-formed.
To reproduce
For example, try running the lastest version of
zstdas shown below:Expected behavior
I expected for
zstdto reject the value passed for--memorysince "LB" isn't a meaningful unit (perhaps the user made a typo and intended to say "KB"). This issue extends to even further malformed inputs, for instance the below example is also accepted without raising an error: