From: David Goulet Date: Tue, 30 Sep 2014 17:31:43 +0000 (-0400) Subject: Add --list-options to save/load command X-Git-Tag: v2.6.0-rc1~26 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=13a810d5e44e4e8e5ce4c1a36456cd0e394d36c2;p=lttng-tools.git Add --list-options to save/load command Fixes #835 Signed-off-by: David Goulet --- diff --git a/src/bin/lttng/commands/load.c b/src/bin/lttng/commands/load.c index 150b880c0..caa571302 100644 --- a/src/bin/lttng/commands/load.c +++ b/src/bin/lttng/commands/load.c @@ -38,6 +38,7 @@ enum { OPT_HELP = 1, OPT_ALL, OPT_FORCE, + OPT_LIST_OPTIONS, }; 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}, + {"list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL}, {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_LIST_OPTIONS: + list_cmd_options(stdout, load_opts); + goto end; case OPT_FORCE: opt_force = 1; break; diff --git a/src/bin/lttng/commands/save.c b/src/bin/lttng/commands/save.c index d90ae0634..67862a4a0 100644 --- a/src/bin/lttng/commands/save.c +++ b/src/bin/lttng/commands/save.c @@ -36,6 +36,7 @@ enum { OPT_HELP = 1, OPT_ALL, OPT_FORCE, + OPT_LIST_OPTIONS, }; 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}, + {"list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL}, {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_LIST_OPTIONS: + list_cmd_options(stdout, save_opts); + goto end; default: usage(stderr); ret = CMD_UNDEFINED;