POSIX getopt(3)
is very permissive of option names. Too permissive if you ask me:
A legitimate option character is any visible one
byte ascii(7) character (for which isgraph(3) would return
nonzero) that is not '-', ':', or ';'.
ArgsParser
uses getopt(3)
internally to read arguments and options, so any arguments that are negative numbers are misinterpreted as options, and you get an Unrecognized option: -3
error. It's fairly rare for negative numbers to be valid arguments, but it does happen: seq
is a good example.
As ArgsParser
knows in advance which options are defined, it should be possible to make it treat unrecognized options which are numbers, as positional arguments instead, to then be parsed separately.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too