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:
+10
-1
@@ -42,7 +42,7 @@ void ffPrintDE(FFDEOptions* options)
|
||||
|
||||
void ffInitDEOptions(FFDEOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_DE_MODULE_NAME, ffParseDECommandOptions, ffParseDEJsonObject, ffPrintDE, ffGenerateDEJson);
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_DE_MODULE_NAME, ffParseDECommandOptions, ffParseDEJsonObject, ffPrintDE, ffGenerateDEJson, ffPrintDEHelpFormat);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
}
|
||||
|
||||
@@ -93,3 +93,12 @@ void ffGenerateDEJson(FF_MAYBE_UNUSED FFDEOptions* options, yyjson_mut_doc* doc,
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "prettyName", &result->dePrettyName);
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "version", &result->deVersion);
|
||||
}
|
||||
|
||||
void ffPrintDEHelpFormat(void)
|
||||
{
|
||||
ffPrintModuleFormatHelp(FF_DE_MODULE_NAME, "{2} {3}", FF_DE_NUM_FORMAT_ARGS, (const char* []) {
|
||||
"DE process name",
|
||||
"DE pretty name",
|
||||
"DE version"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,3 +10,4 @@ bool ffParseDECommandOptions(FFDEOptions* options, const char* key, const char*
|
||||
void ffDestroyDEOptions(FFDEOptions* options);
|
||||
void ffParseDEJsonObject(FFDEOptions* options, yyjson_val* module);
|
||||
void ffGenerateDEJson(FFDEOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
|
||||
void ffPrintDEHelpFormat(void);
|
||||
|
||||
Reference in New Issue
Block a user