event-rule: userspace probe: rename get/set_name to get/set_event_name
[lttng-tools.git] / src / bin / lttng / commands / start.c
index 03d99cf4143b4f5a42245a474af9663d9f2e92d6..7082e097dfa5a3dcc9f9f7b384d7bfbbd90b2ea2 100644 (file)
@@ -1,18 +1,8 @@
 /*
- * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
  *
- * 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
 static char *opt_session_name;
 static struct mi_writer *writer;
 
+#ifdef LTTNG_EMBED_HELP
+static const char help_msg[] =
+#include <lttng-start.1.h>
+;
+#endif
+
 enum {
        OPT_HELP = 1,
        OPT_LIST_OPTIONS,
@@ -138,6 +134,7 @@ int cmd_start(int argc, const char **argv)
 {
        int opt, ret = CMD_SUCCESS, command_ret = CMD_SUCCESS, success = 1;
        static poptContext pc;
+       const char *leftover = NULL;
 
        pc = poptGetContext(NULL, argc, argv, long_options, 0);
        poptReadDefaultConfig(pc, 0);
@@ -158,6 +155,13 @@ int cmd_start(int argc, const char **argv)
 
        opt_session_name = (char*) poptGetArg(pc);
 
+       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.024532 seconds and 4 git commands to generate.