diff options
| -rw-r--r-- | hardinfo/util.c | 8 | ||||
| -rw-r--r-- | includes/hardinfo.h | 1 | ||||
| -rw-r--r-- | modules/benchmark.c | 2 | 
3 files changed, 10 insertions, 1 deletions
diff --git a/hardinfo/util.c b/hardinfo/util.c index 4acb28be..67e5b663 100644 --- a/hardinfo/util.c +++ b/hardinfo/util.c @@ -394,6 +394,7 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param)      static gchar *run_benchmark = NULL;      static gchar *result_format = NULL;      static gchar **use_modules = NULL; +    static gint max_bench_results = 10;      static GOptionEntry options[] = {  	{ @@ -421,6 +422,12 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param)  	 .arg_data = &result_format,  	 .description = N_("benchmark result format ([short], conf, shell)")},  	{ +	 .long_name = "max-results", +	 .short_name = 'n', +	 .arg = G_OPTION_ARG_INT, +	 .arg_data = &max_bench_results, +	 .description = N_("maximum number of benchmark results to include (-1 for no limit, default is 10)")}, +	{  	 .long_name = "list-modules",  	 .short_name = 'l',  	 .arg = G_OPTION_ARG_NONE, @@ -490,6 +497,7 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param)      param->use_modules = use_modules;      param->run_benchmark = run_benchmark;      param->result_format = result_format; +    param->max_bench_results = max_bench_results;      param->autoload_deps = autoload_deps;      param->run_xmlrpc_server = run_xmlrpc_server;      param->skip_benchmarks = skip_benchmarks; diff --git a/includes/hardinfo.h b/includes/hardinfo.h index ab5507bd..881924c5 100644 --- a/includes/hardinfo.h +++ b/includes/hardinfo.h @@ -63,6 +63,7 @@ struct _ProgramParameters {    gboolean markup_ok;    gint     report_format; +  gint     max_bench_results;    gchar  **use_modules;    gchar   *run_benchmark; diff --git a/modules/benchmark.c b/modules/benchmark.c index 9cc7e0b8..1a72e983 100644 --- a/modules/benchmark.c +++ b/modules/benchmark.c @@ -349,7 +349,7 @@ static gchar *__benchmark_include_results(bench_value r,      GKeyFile *conf;      gchar **machines;      gchar *path, *results = g_strdup(""); -    int i, len, loc, win_min, win_max, win_size = 10; +    int i, len, loc, win_min, win_max, win_size = params.max_bench_results;      GSList *result_list = NULL, *li = NULL;  | 
