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:
@@ -68,7 +68,7 @@ void ffPrintMemory(FFMemoryOptions* options)
|
||||
|
||||
void ffInitMemoryOptions(FFMemoryOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_MEMORY_MODULE_NAME, ffParseMemoryCommandOptions, ffParseMemoryJsonObject, ffPrintMemory, ffGenerateMemoryJson);
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_MEMORY_MODULE_NAME, ffParseMemoryCommandOptions, ffParseMemoryJsonObject, ffPrintMemory, ffGenerateMemoryJson, ffPrintMemoryHelpFormat);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
}
|
||||
|
||||
@@ -119,3 +119,12 @@ void ffGenerateMemoryJson(FF_MAYBE_UNUSED FFMemoryOptions* options, yyjson_mut_d
|
||||
yyjson_mut_obj_add_uint(doc, obj, "total", storage.bytesTotal);
|
||||
yyjson_mut_obj_add_uint(doc, obj, "used", storage.bytesUsed);
|
||||
}
|
||||
|
||||
void ffPrintMemoryHelpFormat(void)
|
||||
{
|
||||
ffPrintModuleFormatHelp(FF_MEMORY_MODULE_NAME, "{1} / {2} ({3})", FF_MEMORY_NUM_FORMAT_ARGS, (const char* []) {
|
||||
"Used size",
|
||||
"Total size",
|
||||
"Percentage used"
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user