From: David Goulet Date: Wed, 10 Sep 2014 16:16:48 +0000 (-0400) Subject: Fix: move easter egg after arg parsing else it breaks the mi test X-Git-Tag: v2.6.0-rc1~61 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=883d80f9e038060bccf0512679eb366c7b245d14;p=lttng-tools.git Fix: move easter egg after arg parsing else it breaks the mi test Signed-off-by: David Goulet --- diff --git a/src/bin/lttng/lttng.c b/src/bin/lttng/lttng.c index 2df8b8740..a676be825 100644 --- a/src/bin/lttng/lttng.c +++ b/src/bin/lttng/lttng.c @@ -444,6 +444,7 @@ static int check_args_no_sessiond(int argc, char **argv) static int parse_args(int argc, char **argv) { int opt, ret; + char *user; if (argc < 2) { usage(stderr); @@ -522,6 +523,14 @@ static int parse_args(int argc, char **argv) goto error; } + /* For Mathieu Desnoyers a.k.a. Dr. Tracing */ + user = getenv("USER"); + if (user != NULL && ((strncmp(progname, "drtrace", 7) == 0 || + strncmp("compudj", user, 7) == 0))) { + MSG("%c[%d;%dmWelcome back Dr Tracing!%c[%dm\n", 27,1,33,27,0); + } + /* Thanks Mathieu */ + /* * Handle leftovers which is a first level command with the trailing * options. @@ -568,18 +577,9 @@ error: int main(int argc, char *argv[]) { int ret; - char *user; progname = argv[0] ? argv[0] : "lttng"; - /* For Mathieu Desnoyers a.k.a. Dr. Tracing */ - user = getenv("USER"); - if (user != NULL && ((strncmp(progname, "drtrace", 7) == 0 || - strncmp("compudj", user, 7) == 0))) { - MSG("%c[%d;%dmWelcome back Dr Tracing!%c[%dm\n", 27,1,33,27,0); - } - /* Thanks Mathieu */ - ret = set_signal_handler(); if (ret < 0) { clean_exit(ret);