Move to kernel style SPDX license identifiers
[lttng-tools.git] / src / bin / lttng / commands / load.c
index 0516351ea8ddaddfbe4fdfb312c6f986d16ef6c7..002ec4958945ae2bc7caf9eb3c86537243290a84 100644 (file)
@@ -1,18 +1,8 @@
 /*
- * Copyright (C) 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright (C) 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2 only,
- * as published by the Free Software Foundation.
+ * SPDX-License-Identifier: GPL-2.0-only
  *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #define _LGPL_SOURCE
@@ -37,6 +27,12 @@ static int opt_load_all;
 
 static const char *session_name;
 
+#ifdef LTTNG_EMBED_HELP
+static const char help_msg[] =
+#include <lttng-load.1.h>
+;
+#endif
+
 enum {
        OPT_HELP = 1,
        OPT_ALL,
@@ -157,6 +153,7 @@ int cmd_load(int argc, const char **argv)
        poptContext pc;
        struct lttng_load_session_attr *session_attr = NULL;
        char *input_path = NULL;
+       const char *leftover = NULL;
 
        pc = poptGetContext(NULL, argc, argv, load_opts, 0);
        poptReadDefaultConfig(pc, 0);
@@ -200,6 +197,13 @@ int cmd_load(int argc, const char **argv)
                }
        }
 
+       leftover = poptGetArg(pc);
+       if (leftover) {
+               ERR("Unknown argument: %s", leftover);
+               ret = CMD_ERROR;
+               goto end;
+       }
+
        /* Mi check */
        if (lttng_opt_mi) {
                writer = mi_lttng_writer_create(fileno(stdout), lttng_opt_mi);
This page took 0.024171 seconds and 5 git commands to generate.