CLI11 icon indicating copy to clipboard operation
CLI11 copied to clipboard

<NUMBER> <UNIT> option parsing must take care of wrong usage.

Open nayakche opened this issue 5 years ago • 1 comments

With current master / v1.9.1, it is observed that... for an option relating to <NUMBER> <UNIT> behaves incorrectly in the following scenarios :

  • When options passed by mistake does not contain space. "1ms" is considered as 1 ignoring the significance of ms (millisecond)
  • When unit is not passed at all. "1 " . Same behavior as above. Not as expected.

In my opinion, we need additional check on the input strings before using atoi/atof equivalents.

nayakche avatar Jul 09 '20 08:07 nayakche

Are you using the CLI::AsNumberWithUnit transform? or are you talking about just plain numbers that happen to have strngs at the end?

phlptp avatar Jul 28 '20 13:07 phlptp