Reorganize option parsing for dash
Reorganize option parsing for dash

When getopts hits a short option like '-as' it increments OPTIND, which is
unlike bash where OPTIND is only incremented after all the short options are
done parsing.  So parse as many options as possible before skipping.

thinkerbot/ts,ThomasAdam/ts