Show lttng-metadata man page in command's --help
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 18 Mar 2016 16:26:23 +0000 (12:26 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 18 Mar 2016 19:03:47 +0000 (15:03 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/metadata.c

index 0faf4172a370349fabb2e8a46e7283d634b4bab6..a5776ac141ad96b859e7b950c23b71e0ed195d8b 100644 (file)
@@ -55,23 +55,6 @@ static struct cmd_struct actions[] = {
        { NULL, NULL }  /* Array closure */
 };
 
-/*
- * usage
- */
-static void usage(FILE *ofp)
-{
-       fprintf(ofp, "usage: lttng metadata [OPTION] ACTION\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "Actions:\n");
-       fprintf(ofp, "   regenerate\n");
-       fprintf(ofp, "      Regenerate and overwrite the metadata of the session.\n");
-       fprintf(ofp, "Options:\n");
-       fprintf(ofp, "  -h, --help               Show this help.\n");
-       fprintf(ofp, "      --list-options       Simple listing of options.\n");
-       fprintf(ofp, "  -s, --session NAME       Apply to session name.\n");
-       fprintf(ofp, "\n");
-}
-
 /*
  * Count and return the number of arguments in argv.
  */
@@ -105,7 +88,7 @@ static int handle_command(const char **argv)
        int ret = CMD_SUCCESS, i = 0, argc, command_ret = CMD_SUCCESS;
 
        if (argv == NULL) {
-               usage(stderr);
+               SHOW_HELP();
                command_ret = CMD_ERROR;
                goto end;
        }
@@ -165,7 +148,7 @@ int cmd_metadata(int argc, const char **argv)
        static poptContext pc;
 
        if (argc < 1) {
-               usage(stderr);
+               SHOW_HELP();
                ret = CMD_ERROR;
                goto end;
        }
@@ -199,7 +182,7 @@ int cmd_metadata(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);
@@ -208,7 +191,7 @@ int cmd_metadata(int argc, const char **argv)
                        list_commands(actions, stdout);
                        goto end;
                default:
-                       usage(stderr);
+                       SHOW_HELP();
                        ret = CMD_UNDEFINED;
                        goto end;
                }
This page took 0.027118 seconds and 4 git commands to generate.