add version 1 of getOpt

Code to parse command line arguments. This will change a lot in version
2. But this may help those working on GUI.