Global: improve support of --help *-format

Also fix some bugs found when refactoring
This commit is contained in:
李通洲
2023-10-07 13:40:40 +08:00
parent 23d2cc3fdc
commit 12208b2c7c
113 changed files with 746 additions and 557 deletions
+11 -1
View File
@@ -55,7 +55,7 @@ exit:
void ffInitBiosOptions(FFBiosOptions* options)
{
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_BIOS_MODULE_NAME, ffParseBiosCommandOptions, ffParseBiosJsonObject, ffPrintBios, ffGenerateBiosJson);
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_BIOS_MODULE_NAME, ffParseBiosCommandOptions, ffParseBiosJsonObject, ffPrintBios, ffGenerateBiosJson, ffPrintBiosHelpFormat);
ffOptionInitModuleArg(&options->moduleArgs);
}
@@ -125,3 +125,13 @@ exit:
ffStrbufDestroy(&bios.vendor);
ffStrbufDestroy(&bios.version);
}
void ffPrintBiosHelpFormat(void)
{
ffPrintModuleFormatHelp(FF_BIOS_MODULE_NAME, "{4} ({2})", FF_BIOS_NUM_FORMAT_ARGS, (const char* []) {
"bios date",
"bios release",
"bios vendor",
"bios version"
});
}
+1
View File
@@ -10,3 +10,4 @@ bool ffParseBiosCommandOptions(FFBiosOptions* options, const char* key, const ch
void ffDestroyBiosOptions(FFBiosOptions* options);
void ffParseBiosJsonObject(FFBiosOptions* options, yyjson_val* module);
void ffGenerateBiosJson(FFBiosOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
void ffPrintBiosHelpFormat(void);