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
+10 -1
View File
@@ -51,7 +51,7 @@ void ffPrintLM(FFLMOptions* options)
void ffInitLMOptions(FFLMOptions* options)
{
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_LM_MODULE_NAME, ffParseLMCommandOptions, ffParseLMJsonObject, ffPrintLM, NULL);
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_LM_MODULE_NAME, ffParseLMCommandOptions, ffParseLMJsonObject, ffPrintLM, ffGenerateLMJson, ffPrintLMHelpFormat);
ffOptionInitModuleArg(&options->moduleArgs);
}
@@ -117,3 +117,12 @@ exit:
ffStrbufDestroy(&result.type);
ffStrbufDestroy(&result.version);
}
void ffPrintLMHelpFormat(void)
{
ffPrintModuleFormatHelp(FF_LM_MODULE_NAME, "{1} {3} ({2})", FF_LM_NUM_FORMAT_ARGS, (const char* []) {
"LM service",
"LM type",
"LM version"
});
}
+1
View File
@@ -10,3 +10,4 @@ bool ffParseLMCommandOptions(FFLMOptions* options, const char* key, const char*
void ffDestroyLMOptions(FFLMOptions* options);
void ffParseLMJsonObject(FFLMOptions* options, yyjson_val* module);
void ffGenerateLMJson(FFLMOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
void ffPrintLMHelpFormat(void);