Init: add --disable-stdout-buffer option

This commit is contained in:
李通洲
2022-12-03 22:21:24 +08:00
parent 19ec59cca5
commit 58aa3e94e4
5 changed files with 17 additions and 4 deletions
+6
View File
@@ -33,6 +33,12 @@
# Default is true.
#--multithreading true
# Disable stdout buffer option:
# Sets if fastfetch should disable application buffer of stdout. Mainly for debugging purpose.
# Must be true or false.
# Default is false.
#--disable-stdout-buffer false
# Slow operations option:
# Sets if fastfetch is allowed to use known slow operations to detect more / better values.
# Must be true or false.
+1
View File
@@ -19,6 +19,7 @@ General options:
--load-config <file>: load a config file or a preset (+)
--multithreading <?value>: use multiple threads to detect values
--allow-slow-operations <?value>: allow operations that are usually very slow for more detailed output
--disable-stdout-buffer <?value>: disable stdout application buffer
--escape-bedrock <?value>: on bedrock linux, sets if it should escape the bedrock jail or not
--pipe <?value>: disable logo and all escape sequences
+5
View File
@@ -909,6 +909,11 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
instance->config.multithreading = optionParseBoolean(value);
else if(strcasecmp(key, "--allow-slow-operations") == 0)
instance->config.allowSlowOperations = optionParseBoolean(value);
else if(strcasecmp(key, "--disable-stdout-buffer") == 0)
{
if(optionParseBoolean(value))
setvbuf(stdout, NULL, _IONBF, 0);
}
else if(strcasecmp(key, "--escape-bedrock") == 0)
instance->config.escapeBedrock = optionParseBoolean(value);
else if(strcasecmp(key, "--pipe") == 0)