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
@@ -32,7 +32,7 @@ void ffPrintKernel(FFKernelOptions* options)
void ffInitKernelOptions(FFKernelOptions* options)
{
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_KERNEL_MODULE_NAME, ffParseKernelCommandOptions, ffParseKernelJsonObject, ffPrintKernel, ffGenerateKernelJson);
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_KERNEL_MODULE_NAME, ffParseKernelCommandOptions, ffParseKernelJsonObject, ffPrintKernel, ffGenerateKernelJson, ffPrintKernelHelpFormat);
ffOptionInitModuleArg(&options->moduleArgs);
}
@@ -77,3 +77,12 @@ void ffGenerateKernelJson(FF_MAYBE_UNUSED FFKernelOptions* options, yyjson_mut_d
yyjson_mut_obj_add_strbuf(doc, obj, "version", &instance.state.platform.systemVersion);
yyjson_mut_obj_add_strbuf(doc, obj, "displayVersion", &instance.state.platform.systemDisplayVersion);
}
void ffPrintKernelHelpFormat(void)
{
ffPrintModuleFormatHelp(FF_KERNEL_MODULE_NAME, "{2}", FF_KERNEL_NUM_FORMAT_ARGS, (const char* []) {
"Kernel sysname",
"Kernel release",
"Kernel version"
});
}