mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 00:03:58 +01:00
Global: init support for JSON config file migration (WIP)
This commit is contained in:
+18
-1
@@ -80,6 +80,14 @@ void ffParseBiosJsonObject(FFBiosOptions* options, yyjson_val* module)
|
||||
}
|
||||
}
|
||||
|
||||
void ffGenerateBiosJsonConfig(FFBiosOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
|
||||
{
|
||||
__attribute__((__cleanup__(ffDestroyBiosOptions))) FFBiosOptions defaultOptions;
|
||||
ffInitBiosOptions(&defaultOptions);
|
||||
|
||||
ffJsonConfigGenerateModuleArgsConfig(doc, module, &defaultOptions.moduleArgs, &options->moduleArgs);
|
||||
}
|
||||
|
||||
void ffGenerateBiosJsonResult(FF_MAYBE_UNUSED FFBiosOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
|
||||
{
|
||||
FFBiosResult bios;
|
||||
@@ -127,7 +135,16 @@ void ffPrintBiosHelpFormat(void)
|
||||
|
||||
void ffInitBiosOptions(FFBiosOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_BIOS_MODULE_NAME, ffParseBiosCommandOptions, ffParseBiosJsonObject, ffPrintBios, ffGenerateBiosJsonResult, ffPrintBiosHelpFormat);
|
||||
ffOptionInitModuleBaseInfo(
|
||||
&options->moduleInfo,
|
||||
FF_BIOS_MODULE_NAME,
|
||||
ffParseBiosCommandOptions,
|
||||
ffParseBiosJsonObject,
|
||||
ffPrintBios,
|
||||
ffGenerateBiosJsonResult,
|
||||
ffPrintBiosHelpFormat,
|
||||
ffGenerateBiosJsonConfig
|
||||
);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user