X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbin%2Flttng%2Fcommands%2Fadd_context.c;h=a1b1984b4244c34cf5aca669cae9d57d2c105f9d;hb=7f9bbb9186ad8c7efc7209c44dd1689a338c63dc;hp=df722bb249f39ef8ee28107c501a3b668998ca49;hpb=1e19c0f692117a7e1d2f00b2c434d7bd68485575;p=lttng-tools.git diff --git a/src/bin/lttng/commands/add_context.c b/src/bin/lttng/commands/add_context.c index df722bb24..a1b1984b4 100644 --- a/src/bin/lttng/commands/add_context.c +++ b/src/bin/lttng/commands/add_context.c @@ -41,6 +41,12 @@ static int opt_jul; static int opt_log4j; static char *opt_type; +#ifdef LTTNG_EMBED_HELP +static const char help_msg[] = +#include +; +#endif + enum { OPT_HELP = 1, OPT_TYPE, @@ -892,6 +898,7 @@ int cmd_add_context(int argc, const char **argv) static poptContext pc; struct ctx_type *type, *tmptype; char *session_name = NULL; + const char *leftover = NULL; if (argc < 2) { ret = CMD_ERROR; @@ -938,8 +945,15 @@ int cmd_add_context(int argc, const char **argv) } } - ret = print_missing_or_multiple_domains(opt_kernel + opt_userspace + - opt_jul + opt_log4j); + leftover = poptGetArg(pc); + if (leftover) { + ERR("Unknown argument: %s", leftover); + ret = CMD_ERROR; + goto end; + } + + ret = print_missing_or_multiple_domains( + opt_kernel + opt_userspace + opt_jul + opt_log4j, true); if (ret) { ret = CMD_ERROR; goto end;