From: Jens Steinhauser Date: Sat, 18 Oct 2014 17:58:01 +0000 (+0200) Subject: pdtest: Handle unknown command line arguments. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=cf646afd93e5752fb2f662c7c13df11dd8ab9d73;p=sigrok-test.git pdtest: Handle unknown command line arguments. --- diff --git a/decoder/pdtest b/decoder/pdtest index f9dd140..25dfd83 100755 --- a/decoder/pdtest +++ b/decoder/pdtest @@ -513,7 +513,10 @@ if len(sys.argv) == 1: opt_all = opt_run = opt_show = opt_list = opt_fix = opt_coverage = False report_dir = None -opts, args = getopt(sys.argv[1:], "dvarslfcR:S:") +try: + opts, args = getopt(sys.argv[1:], "dvarslfcR:S:") +except Exception as e: + usage('error while parsing command line arguments: {}'.format(e)) for opt, arg in opts: if opt == '-d': DEBUG += 1