]> sigrok.org Git - sigrok-test.git/blobdiff - decoder/pdtest
pdtest: Handle unknown command line arguments.
[sigrok-test.git] / decoder / pdtest
index f9dd140729201305d7048fd2f2f4d490ab21e70f..25dfd83cb4a8bb85724b3b44cc92c4dd0f13c2da 100755 (executable)
@@ -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