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
@@ -52,7 +52,7 @@ exit:
void ffInitChassisOptions(FFChassisOptions* options)
{
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_CHASSIS_MODULE_NAME, ffParseChassisCommandOptions, ffParseChassisJsonObject, ffPrintChassis, ffGenerateChassisJson);
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_CHASSIS_MODULE_NAME, ffParseChassisCommandOptions, ffParseChassisJsonObject, ffPrintChassis, ffGenerateChassisJson, ffPrintChassisHelpFormat);
ffOptionInitModuleArg(&options->moduleArgs);
}
@@ -119,3 +119,12 @@ exit:
ffStrbufDestroy(&result.vendor);
ffStrbufDestroy(&result.version);
}
void ffPrintChassisHelpFormat(void)
{
ffPrintModuleFormatHelp(FF_CHASSIS_MODULE_NAME, "{1}", FF_CHASSIS_NUM_FORMAT_ARGS, (const char* []) {
"chassis type",
"chassis vendor",
"chassis version"
});
}
+1
View File
@@ -10,3 +10,4 @@ bool ffParseChassisCommandOptions(FFChassisOptions* options, const char* key, co
void ffDestroyChassisOptions(FFChassisOptions* options);
void ffParseChassisJsonObject(FFChassisOptions* options, yyjson_val* module);
void ffGenerateChassisJson(FFChassisOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
void ffPrintChassisHelpFormat(void);