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
@@ -42,7 +42,7 @@ void ffPrintDE(FFDEOptions* options)
void ffInitDEOptions(FFDEOptions* options)
{
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_DE_MODULE_NAME, ffParseDECommandOptions, ffParseDEJsonObject, ffPrintDE, ffGenerateDEJson);
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_DE_MODULE_NAME, ffParseDECommandOptions, ffParseDEJsonObject, ffPrintDE, ffGenerateDEJson, ffPrintDEHelpFormat);
ffOptionInitModuleArg(&options->moduleArgs);
}
@@ -93,3 +93,12 @@ void ffGenerateDEJson(FF_MAYBE_UNUSED FFDEOptions* options, yyjson_mut_doc* doc,
yyjson_mut_obj_add_strbuf(doc, obj, "prettyName", &result->dePrettyName);
yyjson_mut_obj_add_strbuf(doc, obj, "version", &result->deVersion);
}
void ffPrintDEHelpFormat(void)
{
ffPrintModuleFormatHelp(FF_DE_MODULE_NAME, "{2} {3}", FF_DE_NUM_FORMAT_ARGS, (const char* []) {
"DE process name",
"DE pretty name",
"DE version"
});
}
+1
View File
@@ -10,3 +10,4 @@ bool ffParseDECommandOptions(FFDEOptions* options, const char* key, const char*
void ffDestroyDEOptions(FFDEOptions* options);
void ffParseDEJsonObject(FFDEOptions* options, yyjson_val* module);
void ffGenerateDEJson(FFDEOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
void ffPrintDEHelpFormat(void);