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:
@@ -33,7 +33,7 @@ void ffPrintProcesses(FFProcessesOptions* options)
|
||||
|
||||
void ffInitProcessesOptions(FFProcessesOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_PROCESSES_MODULE_NAME, ffParseProcessesCommandOptions, ffParseProcessesJsonObject, ffPrintProcesses, ffGenerateProcessesJson);
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_PROCESSES_MODULE_NAME, ffParseProcessesCommandOptions, ffParseProcessesJsonObject, ffPrintProcesses, ffGenerateProcessesJson, ffPrintProcessesHelpFormat);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
}
|
||||
|
||||
@@ -82,3 +82,10 @@ void ffGenerateProcessesJson(FF_MAYBE_UNUSED FFProcessesOptions* options, yyjson
|
||||
|
||||
yyjson_mut_obj_add_uint(doc, module, "result", result);
|
||||
}
|
||||
|
||||
void ffPrintProcessesHelpFormat(void)
|
||||
{
|
||||
ffPrintModuleFormatHelp(FF_PROCESSES_MODULE_NAME, "{1}", FF_PROCESSES_NUM_FORMAT_ARGS, (const char* []) {
|
||||
"Count"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,3 +10,4 @@ bool ffParseProcessesCommandOptions(FFProcessesOptions* options, const char* key
|
||||
void ffDestroyProcessesOptions(FFProcessesOptions* options);
|
||||
void ffParseProcessesJsonObject(FFProcessesOptions* options, yyjson_val* module);
|
||||
void ffGenerateProcessesJson(FFProcessesOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
|
||||
void ffPrintProcessesHelpFormat(void);
|
||||
|
||||
Reference in New Issue
Block a user