scanning options and arguments from command line simplified and improved