X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fadd_context.c;h=d9121b02a8a53783195507a651d4446210160aea;hb=329f344308786acb81d8939eb8e1ad37307696c2;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..d9121b02a 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,6 +945,13 @@ int cmd_add_context(int argc, const char **argv) } } + 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); if (ret) {