From 54912df23768a0bfcdbf5dd76bb0c9f9792e3f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 14 Dec 2022 13:52:16 +0800 Subject: [PATCH] Option: enable `--show-errors` if `--stat` is set --- src/data/config_user.txt | 3 ++- src/fastfetch.c | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/data/config_user.txt b/src/data/config_user.txt index f7a1be09d..7194b266b 100644 --- a/src/data/config_user.txt +++ b/src/data/config_user.txt @@ -34,7 +34,8 @@ #--multithreading true # Print stat option: -# Sets if fastfetch should print time usage (in ms) for individual modules. +# Sets if fastfetch should print time usage (in ms) for individual modules +# If true, it will also enable --show-errors # Must be true or false. # Default is false. #--stat true diff --git a/src/fastfetch.c b/src/fastfetch.c index aa3401d9e..28a1caa4d 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -910,7 +910,10 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con else if(strcasecmp(key, "--thread") == 0 || strcasecmp(key, "--multithreading") == 0) instance->config.multithreading = optionParseBoolean(value); else if(strcasecmp(key, "--stat") == 0) - instance->config.stat = optionParseBoolean(value); + { + if((instance->config.stat = optionParseBoolean(value))) + instance->config.showErrors = true; + } else if(strcasecmp(key, "--allow-slow-operations") == 0) instance->config.allowSlowOperations = optionParseBoolean(value); else if(strcasecmp(key, "--unbuffered") == 0)