Add --list-options to save/load command
authorDavid Goulet <dgoulet@efficios.com>
Tue, 30 Sep 2014 17:31:43 +0000 (13:31 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 30 Sep 2014 17:31:43 +0000 (13:31 -0400)
Fixes #835

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng/commands/load.c
src/bin/lttng/commands/save.c

index 150b880c0e833b839ee60b1e0abaeda723677090..caa571302782c99f413809e58c7e73ed6b80012f 100644 (file)
@@ -38,6 +38,7 @@ enum {
        OPT_HELP = 1,
        OPT_ALL,
        OPT_FORCE,
        OPT_HELP = 1,
        OPT_ALL,
        OPT_FORCE,
+       OPT_LIST_OPTIONS,
 };
 
 static struct mi_writer *writer;
 };
 
 static struct mi_writer *writer;
@@ -48,6 +49,7 @@ static struct poptOption load_opts[] = {
        {"all",         'a',  POPT_ARG_NONE, 0, OPT_ALL, 0, 0},
        {"input-path",  'i',  POPT_ARG_STRING, &opt_input_path, 0, 0, 0},
        {"force",       'f',  POPT_ARG_NONE, 0, OPT_FORCE, 0, 0},
        {"all",         'a',  POPT_ARG_NONE, 0, OPT_ALL, 0, 0},
        {"input-path",  'i',  POPT_ARG_STRING, &opt_input_path, 0, 0, 0},
        {"force",       'f',  POPT_ARG_NONE, 0, OPT_FORCE, 0, 0},
+       {"list-options",  0,  POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL},
        {0, 0, 0, 0, 0, 0, 0}
 };
 
        {0, 0, 0, 0, 0, 0, 0}
 };
 
@@ -154,6 +156,9 @@ int cmd_load(int argc, const char **argv)
                case OPT_ALL:
                        opt_load_all = 1;
                        break;
                case OPT_ALL:
                        opt_load_all = 1;
                        break;
+               case OPT_LIST_OPTIONS:
+                       list_cmd_options(stdout, load_opts);
+                       goto end;
                case OPT_FORCE:
                        opt_force = 1;
                        break;
                case OPT_FORCE:
                        opt_force = 1;
                        break;
index d90ae06344179d8013e398c59a2a4c57e00049d5..67862a4a02054880da74af7892f0cf2fe5529b48 100644 (file)
@@ -36,6 +36,7 @@ enum {
        OPT_HELP = 1,
        OPT_ALL,
        OPT_FORCE,
        OPT_HELP = 1,
        OPT_ALL,
        OPT_FORCE,
+       OPT_LIST_OPTIONS,
 };
 
 static struct poptOption save_opts[] = {
 };
 
 static struct poptOption save_opts[] = {
@@ -44,6 +45,7 @@ static struct poptOption save_opts[] = {
        {"all",         'a', POPT_ARG_NONE, 0, OPT_ALL, 0, 0},
        {"output-path", 'o', POPT_ARG_STRING, &opt_output_path, 0, 0, 0},
        {"force",       'f', POPT_ARG_NONE, 0, OPT_FORCE, 0, 0},
        {"all",         'a', POPT_ARG_NONE, 0, OPT_ALL, 0, 0},
        {"output-path", 'o', POPT_ARG_STRING, &opt_output_path, 0, 0, 0},
        {"force",       'f', POPT_ARG_NONE, 0, OPT_FORCE, 0, 0},
+       {"list-options",  0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL},
        {0, 0, 0, 0, 0, 0, 0}
 };
 
        {0, 0, 0, 0, 0, 0, 0}
 };
 
@@ -152,6 +154,9 @@ int cmd_save(int argc, const char **argv)
                case OPT_FORCE:
                        opt_force = 1;
                        break;
                case OPT_FORCE:
                        opt_force = 1;
                        break;
+               case OPT_LIST_OPTIONS:
+                       list_cmd_options(stdout, save_opts);
+                       goto end;
                default:
                        usage(stderr);
                        ret = CMD_UNDEFINED;
                default:
                        usage(stderr);
                        ret = CMD_UNDEFINED;
This page took 0.031478 seconds and 4 git commands to generate.