getopt
getopt copied to clipboard
Shift all non-option arguments to the end
Hey, I was looking for exactly this for some project that I wanted to work on Linux & Windows (see https://github.com/eriknyquist/BrainfuckIntern), except that I didn't want the non-option arguments to be required at the end, so I added support for having non-option arguments wherever you like. Here it is in case you want to pull it in. Thanks!
Description:
On first invocation, run over the argument list and shift all non-option arguments to the end of the argument list. This allows non-option arguments to appear anywhere in the argument list, rather than always requiring them at the end. Tested on Debian 9 and Windows 10.