Fixed OPTIND bug and tidied up --
The shell initialises global variable OPTIND to 1 on start up. In order to use getopts in functions, OPTIND must be reinitialised before calling getopts. In bash, it suffices to make OPTIND local, but in busybox, OPTIND must also be set to 1. I also fixed a few formatting slips.
Showing with 46 additions and 47 deletions