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
+12 -1
View File
@@ -45,7 +45,7 @@ void ffPrintFont(FFFontOptions* options)
void ffInitFontOptions(FFFontOptions* options)
{
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_FONT_MODULE_NAME, ffParseFontCommandOptions, ffParseFontJsonObject, ffPrintFont, ffGenerateFontJson);
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_FONT_MODULE_NAME, ffParseFontCommandOptions, ffParseFontJsonObject, ffPrintFont, ffGenerateFontJson, ffPrintFontHelpFormat);
ffOptionInitModuleArg(&options->moduleArgs);
}
@@ -106,3 +106,14 @@ void ffGenerateFontJson(FF_MAYBE_UNUSED FFFontOptions* options, yyjson_mut_doc*
for (uint32_t i = 0; i < FF_DETECT_FONT_NUM_FONTS; ++i)
ffStrbufDestroy(&font.fonts[i]);
}
void ffPrintFontHelpFormat(void)
{
ffPrintModuleFormatHelp(FF_FONT_MODULE_NAME, "{5}", FF_FONT_NUM_FORMAT_ARGS, (const char* []) {
"Font 1",
"Font 2",
"Font 3",
"Font 4",
"Combined fonts"
});
}
+1
View File
@@ -10,3 +10,4 @@ bool ffParseFontCommandOptions(FFFontOptions* options, const char* key, const ch
void ffDestroyFontOptions(FFFontOptions* options);
void ffParseFontJsonObject(FFFontOptions* options, yyjson_val* module);
void ffGenerateFontJson(FFFontOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
void ffPrintFontHelpFormat(void);