naquad/shmig — pull request #4 by mbucc (2014-05-07 01:47:14+00:00)
Title: Multiple command-line options work again.

Sorry, my first pull request broke stuff.

The documentation on getopts [1] actually has the exact scenario we need here; process some options then process the rest of the command-line. This patch uses shift $(($OPTIND - 1)) per that manual.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/getopts.html