mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-31 18:13:38 +01:00
Global: improve support of --help *-format
Also fix some bugs found when refactoring
This commit is contained in:
@@ -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"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user