X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fdestroy.c;h=b0262ea2f0bbf5e1a3ec7e36925f3b3c9e1fccdd;hp=b7931595879b607dca82186f36905f7f6335abd2;hb=ca1c3607d2f5654163875cda874f43971df0f696;hpb=c399183f4b3257c43915f3d81f44befd23165ad9 diff --git a/src/bin/lttng/commands/destroy.c b/src/bin/lttng/commands/destroy.c index b79315958..b0262ea2f 100644 --- a/src/bin/lttng/commands/destroy.c +++ b/src/bin/lttng/commands/destroy.c @@ -31,11 +31,13 @@ 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}, + {"list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL}, {0, 0, 0, 0, 0, 0, 0} }; @@ -50,6 +52,7 @@ static void usage(FILE *ofp) fprintf(ofp, "get it from the configuration directory (.lttng).\n"); fprintf(ofp, "\n"); fprintf(ofp, " -h, --help Show this help\n"); + fprintf(ofp, " --list-options Simple listing of options\n"); fprintf(ofp, "\n"); } @@ -114,7 +117,10 @@ int cmd_destroy(int argc, const char **argv) while ((opt = poptGetNextOpt(pc)) != -1) { switch (opt) { case OPT_HELP: - usage(stderr); + usage(stdout); + goto end; + case OPT_LIST_OPTIONS: + list_cmd_options(stdout, long_options); goto end; default: usage(stderr); @@ -128,5 +134,6 @@ int cmd_destroy(int argc, const char **argv) ret = destroy_session(); end: + poptFreeContext(pc); return ret; }