diff options
author | Burt P <pburt0@gmail.com> | 2017-12-18 21:38:10 -0600 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2018-02-27 07:41:51 -0800 |
commit | 45bf74abab1b665143acbcd3d44e05793dd1b32d (patch) | |
tree | b1c0fdbc2fe5f7623c6b4d8a22c79948203c3103 /hardinfo/util.c | |
parent | c8785521f39c3a86454ade890018ca021272c621 (diff) |
Add cli param to format result for -b
For running benchmarks from the command line, add a new param
to specify the output format:
-g "conf" gives a line suitable for benchmark.conf
-g "shell" gives the complete "moreinfo" shell data
-g "short" (or nothing) gives the bench_value string as before
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'hardinfo/util.c')
-rw-r--r-- | hardinfo/util.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hardinfo/util.c b/hardinfo/util.c index efa19b9c..7bcc5dd5 100644 --- a/hardinfo/util.c +++ b/hardinfo/util.c @@ -390,6 +390,7 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param) static gboolean run_xmlrpc_server = FALSE; static gchar *report_format = NULL; static gchar *run_benchmark = NULL; + static gchar *result_format = NULL; static gchar **use_modules = NULL; static GOptionEntry options[] = { @@ -412,6 +413,12 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param) .arg_data = &run_benchmark, .description = N_("run benchmark; requires benchmark.so to be loaded")}, { + .long_name = "result-format", + .short_name = 'g', + .arg = G_OPTION_ARG_STRING, + .arg_data = &result_format, + .description = N_("benchmark result format ([short], conf, shell)")}, + { .long_name = "list-modules", .short_name = 'l', .arg = G_OPTION_ARG_NONE, @@ -468,6 +475,7 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param) param->list_modules = list_modules; param->use_modules = use_modules; param->run_benchmark = run_benchmark; + param->result_format = result_format; param->autoload_deps = autoload_deps; param->run_xmlrpc_server = run_xmlrpc_server; param->argv0 = *(argv)[0]; |