mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 16:26:39 +01:00
Global: improve support of --help *-format
Also fix some bugs found when refactoring
This commit is contained in:
@@ -47,7 +47,7 @@ void ffPrintVersion(FFVersionOptions* options)
|
||||
|
||||
void ffInitVersionOptions(FFVersionOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_VERSION_MODULE_NAME, ffParseVersionCommandOptions, ffParseVersionJsonObject, ffPrintVersion, ffGenerateVersionJson);
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_VERSION_MODULE_NAME, ffParseVersionCommandOptions, ffParseVersionJsonObject, ffPrintVersion, ffGenerateVersionJson, ffPrintVersionHelpFormat);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
}
|
||||
|
||||
@@ -114,3 +114,18 @@ void ffGenerateVersionJson(FF_MAYBE_UNUSED FFVersionOptions* options, yyjson_mut
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "libc", &buf);
|
||||
}
|
||||
}
|
||||
|
||||
void ffPrintVersionHelpFormat(void)
|
||||
{
|
||||
ffPrintModuleFormatHelp(FF_VERSION_MODULE_NAME, "{1} {2}{3} ({5})", FF_VERSION_NUM_FORMAT_ARGS, (const char* []) {
|
||||
"Project name",
|
||||
"Version",
|
||||
"Version tweak",
|
||||
"Build type (debug or release)",
|
||||
"Architecture",
|
||||
"CMake build type (Debug, Release, RelWithDebInfo, MinSizeRel)",
|
||||
"Date time when compiling",
|
||||
"Compiler used",
|
||||
"Libc used"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,3 +10,4 @@ bool ffParseVersionCommandOptions(FFVersionOptions* options, const char* key, co
|
||||
void ffDestroyVersionOptions(FFVersionOptions* options);
|
||||
void ffParseVersionJsonObject(FFVersionOptions* options, yyjson_val* module);
|
||||
void ffGenerateVersionJson(FFVersionOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
|
||||
void ffPrintVersionHelpFormat(void);
|
||||
|
||||
Reference in New Issue
Block a user