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
@@ -43,7 +43,7 @@ void ffPrintWM(FFWMOptions* options)
|
||||
|
||||
void ffInitWMOptions(FFWMOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_WM_MODULE_NAME, ffParseWMCommandOptions, ffParseWMJsonObject, ffPrintWM, ffGenerateWMJson);
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_WM_MODULE_NAME, ffParseWMCommandOptions, ffParseWMJsonObject, ffPrintWM, ffGenerateWMJson, ffPrintWMHelpFormat);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
}
|
||||
|
||||
@@ -93,3 +93,12 @@ void ffGenerateWMJson(FF_MAYBE_UNUSED FFWMOptions* options, yyjson_mut_doc* doc,
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "prettyName", &result->wmPrettyName);
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "protocolName", &result->wmProtocolName);
|
||||
}
|
||||
|
||||
void ffPrintWMHelpFormat(void)
|
||||
{
|
||||
ffPrintModuleFormatHelp(FF_WM_MODULE_NAME, "{2} ({3})", FF_WM_NUM_FORMAT_ARGS, (const char* []) {
|
||||
"WM process name",
|
||||
"WM pretty name",
|
||||
"WM protocol name"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,3 +10,4 @@ bool ffParseWMCommandOptions(FFWMOptions* options, const char* key, const char*
|
||||
void ffDestroyWMOptions(FFWMOptions* options);
|
||||
void ffParseWMJsonObject(FFWMOptions* options, yyjson_val* module);
|
||||
void ffGenerateWMJson(FFWMOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
|
||||
void ffPrintWMHelpFormat(void);
|
||||
|
||||
Reference in New Issue
Block a user