[Zope-Checkins] CVS: Zope2 - testrunner.py:1.6.2.3

fred@digicool.com fred@digicool.com
Tue, 5 Jun 2001 16:35:16 -0400 (EDT)


Update of /cvs-repository/Zope2/utilities
In directory korak.digicool.com:/tmp/cvs-serv9210/utilities

Modified Files:
      Tag: zope-2_3-branch
	testrunner.py 
Log Message:

Only print the usage message once when given no args.
Use the conventional Unix return code for command-line errors when
appropriate.



--- Updated File testrunner.py in package Zope2 --
--- testrunner.py	2001/03/30 16:02:43	1.6.2.2
+++ testrunner.py	2001/06/05 20:35:16	1.6.2.3
@@ -171,10 +171,11 @@
             elif name == 'f':
                 filename=string.strip(value)
             elif name == 'h':
-                err_exit(usage_msg)
+                err_exit(usage_msg, rc=0)
             else:
                 err_exit(usage_msg)
-
+    except SystemExit:
+        raise
     except:
         err_exit(usage_msg)
 
@@ -188,9 +189,9 @@
     sys.exit(0)
 
 
-def err_exit(message):
+def err_exit(message, rc=2):
     sys.stderr.write("\n%s\n" % message)
-    sys.exit(1)
+    sys.exit(rc)
 
 
 if __name__ == '__main__':