fixed command line mode getopt never exiting