From: Jérémie Galarneau Date: Fri, 18 Mar 2016 16:26:23 +0000 (-0400) Subject: Show lttng-metadata man page in command's --help X-Git-Tag: v2.8.0-rc1~12 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3b9c7d3f74eddfb5efe444a428f3564bfe3017f0;p=lttng-tools.git Show lttng-metadata man page in command's --help Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng/commands/metadata.c b/src/bin/lttng/commands/metadata.c index 0faf4172a..a5776ac14 100644 --- a/src/bin/lttng/commands/metadata.c +++ b/src/bin/lttng/commands/metadata.c @@ -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; }