mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 08:13:44 +01:00
Global: improve support of --help *-format
Also fix some bugs found when refactoring
This commit is contained in:
+12
-1
@@ -67,7 +67,7 @@ exit:
|
||||
|
||||
void ffInitHostOptions(FFHostOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_HOST_MODULE_NAME, ffParseHostCommandOptions, ffParseHostJsonObject, ffPrintHost, ffGenerateHostJson);
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_HOST_MODULE_NAME, ffParseHostCommandOptions, ffParseHostJsonObject, ffPrintHost, ffGenerateHostJson, ffPrintHostHelpFormat);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
}
|
||||
|
||||
@@ -139,3 +139,14 @@ exit:
|
||||
ffStrbufDestroy(&host.productSku);
|
||||
ffStrbufDestroy(&host.sysVendor);
|
||||
}
|
||||
|
||||
void ffPrintHostHelpFormat(void)
|
||||
{
|
||||
ffPrintModuleFormatHelp(FF_HOST_MODULE_NAME, "{2} {3}", FF_HOST_NUM_FORMAT_ARGS, (const char* []) {
|
||||
"product family",
|
||||
"product name",
|
||||
"product version",
|
||||
"product sku",
|
||||
"sys vendor"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,3 +10,4 @@ bool ffParseHostCommandOptions(FFHostOptions* options, const char* key, const ch
|
||||
void ffDestroyHostOptions(FFHostOptions* options);
|
||||
void ffParseHostJsonObject(FFHostOptions* options, yyjson_val* module);
|
||||
void ffGenerateHostJson(FFHostOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
|
||||
void ffPrintHostHelpFormat(void);
|
||||
|
||||
Reference in New Issue
Block a user