X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=lttng%2Flttng.c;h=69b563d4a643eb80db6718673602ebe67efb9c4b;hp=d0f23579d4af38db63ba9ec2e9f76aaa7155b299;hb=734f79bf717d87817623d382c59086dc9e8ef610;hpb=b551a063b85ebdf0accaf2bbe06d0231a7b50f23 diff --git a/lttng/lttng.c b/lttng/lttng.c index d0f23579d..69b563d4a 100644 --- a/lttng/lttng.c +++ b/lttng/lttng.c @@ -359,6 +359,23 @@ end: return ret; } +/* + * Check for the "help" option in the argv. If found, return 1 else return 0. + */ +static int check_help_command(int argc, char **argv) +{ + int i; + + for (i = 0; i < argc; i++) { + if ((strncmp(argv[i], "-h", 2) == 0) || + strncmp(argv[i], "--h", 3) == 0) { + return 1; + } + } + + return 0; +} + /* * parse_args * @@ -414,7 +431,8 @@ static int parse_args(int argc, char **argv) } /* Spawn session daemon if needed */ - if (opt_no_sessiond == 0 && (check_sessiond() < 0)) { + if (opt_no_sessiond == 0 && check_help_command(argc, argv) == 0 && + (check_sessiond() < 0)) { goto error; }