JsonConfig: write all flags when generating config file

This commit is contained in:
李通洲
2025-08-04 16:46:28 +08:00
parent e753d4d3a4
commit fa4e11c73b
83 changed files with 700 additions and 932 deletions
+4 -10
View File
@@ -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)