Move to kernel style SPDX license identifiers
[lttng-tools.git] / src / bin / lttng / commands / set_session.c
index d41dc1d191ccf2be56935c3b06e87e596a657ecd..947feb9d44dff4b64058e6797e3560c771b3a2e4 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;
 
+#ifdef LTTNG_EMBED_HELP
+static const char help_msg[] =
+#include <lttng-set-session.1.h>
+;
+#endif
+
 enum {
        OPT_HELP = 1,
        OPT_LIST_OPTIONS,
@@ -45,19 +41,6 @@ static struct poptOption long_options[] = {
        {0, 0, 0, 0, 0, 0, 0}
 };
 
-/*
- * usage
- */
-static void usage(FILE *ofp)
-{
-       fprintf(ofp, "usage: lttng set-session NAME [OPTIONS]\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "Options:\n");
-       fprintf(ofp, "  -h, --help               Show this help\n");
-       fprintf(ofp, "      --list-options       Simple listing of options\n");
-       fprintf(ofp, "\n");
-}
-
 /*
  * Print the necessary mi for a session and name.
  */
@@ -180,7 +163,6 @@ int cmd_set_session(int argc, const char **argv)
                        list_cmd_options(stdout, long_options);
                        goto end;
                default:
-                       usage(stderr);
                        ret = CMD_UNDEFINED;
                        goto end;
                }
@@ -189,7 +171,6 @@ int cmd_set_session(int argc, const char **argv)
        opt_session_name = (char *) poptGetArg(pc);
        if (opt_session_name == NULL) {
                ERR("Missing session name");
-               usage(stderr);
                ret = CMD_ERROR;
                goto end;
        }
@@ -256,7 +237,7 @@ end:
                ret = ret ? ret : LTTNG_ERR_MI_IO_FAIL;
        }
 
-       /* Overwrite ret if an error occured during set_session() */
+       /* Overwrite ret if an error occurred during set_session() */
        ret = command_ret ? command_ret : ret;
 
        poptFreeContext(pc);
This page took 0.025427 seconds and 5 git commands to generate.