3 ms·
> GNU Getopts is the best we get, while if we go down the strict POSIX path, users would apparently rather use an idiomatic loop over `shift` than a similer loo
by rascul 4y ago
> GNU Getopts is the best we get, while if we go down the strict POSIX path, users would apparently rather use an idiomatic loop over `shift` than a similer loop over the portable `getopt`
getopts is POSIX, and GNU getopts is an implementation of it. [0] The getopt utility is not POSIX (not the command line tool anyway, not in current POSIX) and should not be used. [1]
[0] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/getopts.html https://pubs.opengroup.org/onlinepubs/9699919799/utilities/g...
[1] http://mywiki.wooledge.org/ComplexOptionParsing http://mywiki.wooledge.org/ComplexOptionParsing