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
+8 -1
View File
@@ -32,7 +32,7 @@ void ffPrintLocale(FFLocaleOptions* options)
void ffInitLocaleOptions(FFLocaleOptions* options)
{
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_LOCALE_MODULE_NAME, ffParseLocaleCommandOptions, ffParseLocaleJsonObject, ffPrintLocale, ffGenerateLocaleJson);
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_LOCALE_MODULE_NAME, ffParseLocaleCommandOptions, ffParseLocaleJsonObject, ffPrintLocale, ffGenerateLocaleJson, ffPrintLocaleHelpFormat);
ffOptionInitModuleArg(&options->moduleArgs);
}
@@ -81,3 +81,10 @@ void ffGenerateLocaleJson(FF_MAYBE_UNUSED FFLocaleOptions* options, yyjson_mut_d
yyjson_mut_obj_add_strbuf(doc, module, "result", &locale);
}
void ffPrintLocaleHelpFormat(void)
{
ffPrintModuleFormatHelp(FF_LOCALE_MODULE_NAME, "{1}", FF_LOCALE_NUM_FORMAT_ARGS, (const char* []) {
"Locale code"
});
}
+1
View File
@@ -10,3 +10,4 @@ bool ffParseLocaleCommandOptions(FFLocaleOptions* options, const char* key, cons
void ffDestroyLocaleOptions(FFLocaleOptions* options);
void ffParseLocaleJsonObject(FFLocaleOptions* options, yyjson_val* module);
void ffGenerateLocaleJson(FFLocaleOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
void ffPrintLocaleHelpFormat(void);