lttng: Add list-triggers command
[lttng-tools.git] / src / bin / lttng / commands / status.c
index b3555c9840cba2f2cba2463bcfc448f31d2d93f9..23e8c03d390bc8fa2007cd82e7e271ec5bcda810 100644 (file)
@@ -1,21 +1,10 @@
 /*
- * Copyright (C) 2015 Philippe Proulx <pproulx@efficios.com>
+ * Copyright (C) 2015 Philippe Proulx <pproulx@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 _GNU_SOURCE
 #define _LGPL_SOURCE
 #include <popt.h>
 #include <stdio.h>
 #include "../utils.h"
 #include <config.h>
 
+#ifdef LTTNG_EMBED_HELP
+static const char help_msg[] =
+#include <lttng-status.1.h>
+;
+#endif
+
 enum {
        OPT_HELP = 1,
        OPT_LIST_OPTIONS,
@@ -41,15 +36,6 @@ static struct poptOption long_options[] = {
        {0, 0, 0, 0, 0, 0, 0}
 };
 
-static void usage(FILE *ofp)
-{
-       fprintf(ofp, "Usage: lttng status [options]\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "Options:\n");
-       fprintf(ofp, "  -h, --help          Show this help\n");
-       fprintf(ofp, "      --list-options  List options\n");
-}
-
 static int status(void)
 {
        const char *argv[2];
@@ -84,13 +70,12 @@ int cmd_status(int argc, const char **argv)
        while ((opt = poptGetNextOpt(pc)) != -1) {
                switch (opt) {
                case OPT_HELP:
-                       usage(stdout);
+                       SHOW_HELP();
                        goto end;
                case OPT_LIST_OPTIONS:
                        list_cmd_options(stdout, long_options);
                        goto end;
                default:
-                       usage(stderr);
                        ret = CMD_UNDEFINED;
                        goto end;
                }
@@ -98,7 +83,6 @@ int cmd_status(int argc, const char **argv)
 
        if (poptPeekArg(pc) != NULL) {
                ERR("This command does not accept positional arguments.\n");
-               usage(stderr);
                ret = CMD_UNDEFINED;
                goto end;
        }
This page took 0.024305 seconds and 4 git commands to generate.