]> sigrok.org Git - sigrok-test.git/blobdiff - decoder/pdtest
pdtest: Minor help text improvements.
[sigrok-test.git] / decoder / pdtest
index f9dd140729201305d7048fd2f2f4d490ab21e70f..897e3ef4f2d200e2c91f7ee0639db147fda58cf3 100755 (executable)
@@ -55,17 +55,17 @@ def ERR(msg):
 def usage(msg=None):
     if msg:
         print(msg.strip() + '\n')
-    print("""Usage: testpd [-dvarslR] [test, ...]
+    print("""Usage: testpd [-dvalsrfcR] [<test1> <test2> ...]
   -d  Turn on debugging
   -v  Verbose
   -a  All tests
-  -l  List all tests
+  -l  List test(s)
   -s  Show test(s)
   -r  Run test(s)
   -f  Fix failed test(s)
   -c  Report decoder code coverage
   -R <directory>  Save test reports to <directory>
-  <test>  Protocol decoder name ("i2c") and optionally test name ("i2c/icc")""")
+  <test>  Protocol decoder name ("i2c") and optionally test name ("i2c/rtc")""")
     sys.exit()
 
 
@@ -327,7 +327,7 @@ def run_tests(tests, fix=False):
                         opargs[-1] += ":%s" % op['class']
                         name += "/%s" % op['class']
                     if VERBOSE:
-                        dots = '.' * (60 - len(name) - 2)
+                        dots = '.' * (77 - len(name) - 2)
                         INFO("%s %s " % (name, dots), end='')
                     results.append({
                         'testcase': name,
@@ -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