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
@@ -107,7 +107,7 @@ void ffPrintMedia(FFMediaOptions* options)
void ffInitMediaOptions(FFMediaOptions* options)
{
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_MEDIA_MODULE_NAME, ffParseMediaCommandOptions, ffParseMediaJsonObject, ffPrintMedia, ffGenerateMediaJson);
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_MEDIA_MODULE_NAME, ffParseMediaCommandOptions, ffParseMediaJsonObject, ffPrintMedia, ffGenerateMediaJson, ffPrintMediaHelpFormat);
ffOptionInitModuleArg(&options->moduleArgs);
}
@@ -159,3 +159,14 @@ void ffGenerateMediaJson(FF_MAYBE_UNUSED FFMediaOptions* options, yyjson_mut_doc
yyjson_mut_obj_add_strbuf(doc, obj, "album", &media->album);
yyjson_mut_obj_add_strbuf(doc, obj, "status", &media->status);
}
void ffPrintMediaHelpFormat(void)
{
ffPrintModuleFormatHelp(FF_MEDIA_MODULE_NAME, "{3} - {1} ({5})", FF_MEDIA_NUM_FORMAT_ARGS, (const char* []) {
"Pretty media name",
"Media name",
"Artist name",
"Album name",
"Status",
});
}
+1
View File
@@ -10,3 +10,4 @@ bool ffParseMediaCommandOptions(FFMediaOptions* options, const char* key, const
void ffDestroyMediaOptions(FFMediaOptions* options);
void ffParseMediaJsonObject(FFMediaOptions* options, yyjson_val* module);
void ffGenerateMediaJson(FFMediaOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
void ffPrintMediaHelpFormat(void);