implement command line parsing and error detection