diff --git a/tren.py b/tren.py index 498759d..8451806 100755 --- a/tren.py +++ b/tren.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "tren.py" -RCSID = "$Id: tren.py,v 1.106 2010/01/23 01:00:00 tundra Exp $" +RCSID = "$Id: tren.py,v 1.107 2010/01/23 01:12:16 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -81,8 +81,8 @@ # Error Messages ##### -eBADARG = "Invalid or malformed command line argument!" -eBADINCL = "%s Option Missing Filename Specification!" % INCL +eBADARG = "Invalid Command Line: %s!" +eBADINCL = "option %s requires argument" % INCL eERROR = "ERROR" eFILEOPEN = "Cannot Open File '%s': %s!" eTOOMANYINC = "Too Many Includes! (Max Is %d) Possible Circular Reference?" % MAXINCLUDES @@ -295,7 +295,7 @@ i = OPTIONS.index(INCL) if i == len(OPTIONS)-1: - ErrorMsg(eBADINCL) + ErrorMsg(eBADARG % eBADINCL) sys.exit(1) file = OPTIONS[i+1] ; lhs = OPTIONS[:i] ; rhs = OPTIONS[i+2:] @@ -329,9 +329,8 @@ try: opts, args = getopt.getopt(OPTIONS, '1abbCcdEefghl:qr:tvXx]') -except getopt.GetoptError: - ErrorMsg(eBADARG) - Usage() +except getopt.GetoptError as e: + ErrorMsg(eBADARG % e.args[0]) sys.exit(1) for opt, val in opts: