Fix: lttng: incorrect domain list printed when no domain is provided
[lttng-tools.git] / src / bin / lttng / commands / add_context.c
index 209a9f4eb1eba9a804b701d017f46a7598ad65fa..a1b1984b4244c34cf5aca669cae9d57d2c105f9d 100644 (file)
@@ -898,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;
@@ -944,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;
This page took 0.024495 seconds and 4 git commands to generate.