Cleanup lttng-gen-tp: Help not showing when using -h,--help
authorChristian Babeux <christian.babeux@efficios.com>
Thu, 13 Dec 2012 21:06:12 +0000 (16:06 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 13 Dec 2012 21:06:12 +0000 (16:06 -0500)
Fixes #299

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tools/lttng-gen-tp

index 2075655559a582a214551a0b397ca609aaebc381..adaa278cb2919dc158d9e69c2be8d97d032e5838 100755 (executable)
@@ -207,8 +207,6 @@ def main(argv=None):
             opts, args = getopt.gnu_getopt(argv[1:], "ho:a", ["help"])
         except getopt.error, msg:
              raise Usage(msg)
-        if len(args) == 0:
-            raise Usage("No template file given")
 
     except Usage, err:
         print >>sys.stderr, err.msg
@@ -224,6 +222,14 @@ def main(argv=None):
             outputNames.append(a)
         if o in ("-a",""):
             all = True
+    try:
+        if len(args) == 0:
+            raise Usage("No template file given")
+
+    except Usage, err:
+        print >>sys.stderr, err.msg
+        print >>sys.stderr, "for help use --help"
+        return 2
 
     doCFile = None
     doHeader = None
This page took 0.026432 seconds and 4 git commands to generate.