parse command line args smartly