mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 16:26:39 +01:00
JsonConfig: write all flags when generating config file
This commit is contained in:
@@ -76,19 +76,13 @@ void ffParseCommandJsonObject(FFCommandOptions* options, yyjson_val* module)
|
||||
|
||||
void ffGenerateCommandJsonConfig(FFCommandOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
|
||||
{
|
||||
__attribute__((__cleanup__(ffDestroyCommandOptions))) FFCommandOptions defaultOptions;
|
||||
ffInitCommandOptions(&defaultOptions);
|
||||
ffJsonConfigGenerateModuleArgsConfig(doc, module, &options->moduleArgs);
|
||||
|
||||
ffJsonConfigGenerateModuleArgsConfig(doc, module, &defaultOptions.moduleArgs, &options->moduleArgs);
|
||||
yyjson_mut_obj_add_strbuf(doc, module, "shell", &options->shell);
|
||||
|
||||
if (!ffStrbufEqual(&defaultOptions.shell, &options->shell))
|
||||
yyjson_mut_obj_add_strbuf(doc, module, "shell", &options->shell);
|
||||
yyjson_mut_obj_add_strbuf(doc, module, "param", &options->param);
|
||||
|
||||
if (!ffStrbufEqual(&defaultOptions.param, &options->param))
|
||||
yyjson_mut_obj_add_strbuf(doc, module, "param", &options->param);
|
||||
|
||||
if (!ffStrbufEqual(&defaultOptions.text, &options->text))
|
||||
yyjson_mut_obj_add_strbuf(doc, module, "text", &options->text);
|
||||
yyjson_mut_obj_add_strbuf(doc, module, "text", &options->text);
|
||||
}
|
||||
|
||||
void ffGenerateCommandJsonResult(FF_MAYBE_UNUSED FFCommandOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
|
||||
|
||||
Reference in New Issue
Block a user