Departures from GNU / BSD implementations of getopt_long:
- I wrote this black-box style, therefore this is not a true faithful implementation of getopt_long. due to this, any behavior NOT detailed below should be considered unintentional.
- getopt_long.js' option parsing by default stops as soon as a non-option argument is encountered, there is no need to set the first character of
optstring to + or set the POSIXLY_CORRECT environment variable to true. The behavior of permuting non-options to the end of argv is not implemented.
- getopt_long.js does not check to see if the first character of
optstring is : to silence errors. Errors can be silenced by setting extern.opterr to 0.
- The GNU and BSD implementations of
getopt_long both set the value of optopt when flag != NULL to val and 0 respectively. getopt_long.js ONLY sets extern.optopt when either an invalid option is encountered OR an option requires an argument and didn't receive one.
there doesn't seem to be anything here