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
+11 -1
View File
@@ -85,7 +85,7 @@ void ffPrintSound(FFSoundOptions* options)
void ffInitSoundOptions(FFSoundOptions* options)
{
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_SOUND_MODULE_NAME, ffParseSoundCommandOptions, ffParseSoundJsonObject, ffPrintSound, ffGenerateSoundJson);
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_SOUND_MODULE_NAME, ffParseSoundCommandOptions, ffParseSoundJsonObject, ffPrintSound, ffGenerateSoundJson, ffPrintSoundHelpFormat);
ffOptionInitModuleArg(&options->moduleArgs);
options->soundType = FF_SOUND_TYPE_MAIN;
@@ -189,3 +189,13 @@ void ffGenerateSoundJson(FF_MAYBE_UNUSED FFSoundOptions* options, yyjson_mut_doc
ffStrbufDestroy(&device->name);
}
}
void ffPrintSoundHelpFormat(void)
{
ffPrintModuleFormatHelp(FF_SOUND_MODULE_NAME, "{2} ({3}%)", FF_SOUND_NUM_FORMAT_ARGS, (const char* []) {
"Is main sound device",
"Device name",
"Volume",
"Identifier"
});
}
+1
View File
@@ -10,3 +10,4 @@ bool ffParseSoundCommandOptions(FFSoundOptions* options, const char* key, const
void ffDestroySoundOptions(FFSoundOptions* options);
void ffParseSoundJsonObject(FFSoundOptions* options, yyjson_val* module);
void ffGenerateSoundJson(FFSoundOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
void ffPrintSoundHelpFormat(void);