From a719be6472181c3d633c17b7f8e877f420d0c358 Mon Sep 17 00:00:00 2001 From: Christian Babeux Date: Thu, 13 Dec 2012 16:06:12 -0500 Subject: [PATCH] Cleanup lttng-gen-tp: Help not showing when using -h,--help Fixes #299 Signed-off-by: Christian Babeux Signed-off-by: Mathieu Desnoyers --- tools/lttng-gen-tp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 -- 2.34.1