X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fcreate.c;h=0765c823b4209bf4b947a61772837cf1ca7e4947;hp=835d82a4f9d7c7b9523a574fb0ef6cda53f8de5f;hb=74cc1d0fc1cbb2374e812b21d42b44e54f908dc0;hpb=c399183f4b3257c43915f3d81f44befd23165ad9 diff --git a/src/bin/lttng/commands/create.c b/src/bin/lttng/commands/create.c index 835d82a4f..0765c823b 100644 --- a/src/bin/lttng/commands/create.c +++ b/src/bin/lttng/commands/create.c @@ -27,18 +27,21 @@ #include #include "../command.h" +#include "../utils.h" static char *opt_output_path; static char *opt_session_name; enum { OPT_HELP = 1, + OPT_LIST_OPTIONS, }; static struct poptOption long_options[] = { /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */ - {"help", 'h', POPT_ARG_NONE, 0, OPT_HELP, 0, 0}, - {"output", 'o', POPT_ARG_STRING, &opt_output_path, 0, 0, 0}, + {"help", 'h', POPT_ARG_NONE, NULL, OPT_HELP, NULL, NULL}, + {"output", 'o', POPT_ARG_STRING, &opt_output_path, 0, NULL, NULL}, + {"list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL}, {0, 0, 0, 0, 0, 0, 0} }; @@ -50,6 +53,7 @@ static void usage(FILE *ofp) fprintf(ofp, "usage: lttng create [options] [NAME]\n"); fprintf(ofp, "\n"); fprintf(ofp, " -h, --help Show this help\n"); + fprintf(ofp, " --list-options Simple listing of options\n"); fprintf(ofp, " -o, --output PATH Specify output path for traces\n"); fprintf(ofp, "\n"); } @@ -143,9 +147,9 @@ error: } /* - * cmd_list + * cmd_create * - * The 'list ' first level command + * The 'create ' first level command */ int cmd_create(int argc, const char **argv) { @@ -160,6 +164,10 @@ int cmd_create(int argc, const char **argv) case OPT_HELP: usage(stderr); goto end; + case OPT_LIST_OPTIONS: + list_cmd_options(stdout, long_options); + ret = CMD_SUCCESS; + goto end; default: usage(stderr); ret = CMD_UNDEFINED;