From: Christian Babeux Date: Thu, 13 Dec 2012 21:06:12 +0000 (-0500) Subject: Cleanup lttng-gen-tp: Help not showing when using -h,--help X-Git-Tag: v2.1.0~14 X-Git-Url: http://git.lttng.org/?a=commitdiff_plain;h=a719be6472181c3d633c17b7f8e877f420d0c358;p=lttng-ust.git Cleanup lttng-gen-tp: Help not showing when using -h,--help Fixes #299 Signed-off-by: Christian Babeux Signed-off-by: Mathieu Desnoyers --- diff --git a/tools/lttng-gen-tp b/tools/lttng-gen-tp index 20756555..adaa278c 100755 --- a/tools/lttng-gen-tp +++ b/tools/lttng-gen-tp @@ -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