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
+19 -1
View File
@@ -138,7 +138,7 @@ void ffPrintOS(FFOSOptions* options)
void ffInitOSOptions(FFOSOptions* options)
{
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_OS_MODULE_NAME, ffParseOSCommandOptions, ffParseOSJsonObject, ffPrintOS, ffGenerateOSJson);
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_OS_MODULE_NAME, ffParseOSCommandOptions, ffParseOSJsonObject, ffPrintOS, ffGenerateOSJson, ffPrintOSHelpFormat);
ffOptionInitModuleArg(&options->moduleArgs);
}
@@ -196,3 +196,21 @@ void ffGenerateOSJson(FF_MAYBE_UNUSED FFOSOptions* options, yyjson_mut_doc* doc,
yyjson_mut_obj_add_strbuf(doc, obj, "version", &os->version);
yyjson_mut_obj_add_strbuf(doc, obj, "versionID", &os->versionID);
}
void ffPrintOSHelpFormat(void)
{
ffPrintModuleFormatHelp(FF_OS_MODULE_NAME, "{3} {10} {12}", FF_OS_NUM_FORMAT_ARGS, (const char* []) {
"Name of the kernel (Linux, WIN32_NT, Darwin, FreeBSD)",
"Name of the OS",
"Pretty name of the OS",
"ID of the OS",
"ID like of the OS",
"Variant of the OS",
"Variant ID of the OS",
"Version of the OS",
"Version ID of the OS",
"Version codename of the OS",
"Build ID of the OS",
"Architecture of the OS"
});
}
+1
View File
@@ -10,3 +10,4 @@ bool ffParseOSCommandOptions(FFOSOptions* options, const char* key, const char*
void ffDestroyOSOptions(FFOSOptions* options);
void ffParseOSJsonObject(FFOSOptions* options, yyjson_val* module);
void ffGenerateOSJson(FFOSOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
void ffPrintOSHelpFormat(void);