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