Fastfetch: fully resolve the format arg num issue

Ref: #749
This commit is contained in:
李通洲
2024-03-07 10:47:28 +08:00
parent 064972aecd
commit 6dcfb6b88f
59 changed files with 295 additions and 277 deletions
+5 -5
View File
@@ -58,11 +58,11 @@ void ffPrintMemory(FFMemoryOptions* options)
{
FF_STRBUF_AUTO_DESTROY percentageStr = ffStrbufCreate();
ffPercentAppendNum(&percentageStr, percentage, options->percent, false);
ffPrintFormat(FF_MEMORY_MODULE_NAME, 0, &options->moduleArgs, FF_MEMORY_NUM_FORMAT_ARGS, (FFformatarg[]){
FF_PRINT_FORMAT_CHECKED(FF_MEMORY_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_MEMORY_NUM_FORMAT_ARGS, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_STRBUF, &usedPretty},
{FF_FORMAT_ARG_TYPE_STRBUF, &totalPretty},
{FF_FORMAT_ARG_TYPE_STRBUF, &percentageStr},
});
}));
}
}
@@ -127,11 +127,11 @@ void ffGenerateMemoryJsonResult(FF_MAYBE_UNUSED FFMemoryOptions* options, yyjson
void ffPrintMemoryHelpFormat(void)
{
ffPrintModuleFormatHelp(FF_MEMORY_MODULE_NAME, "{1} / {2} ({3})", FF_MEMORY_NUM_FORMAT_ARGS, (const char* []) {
FF_PRINT_MODULE_FORMAT_HELP_CHECKED(FF_MEMORY_MODULE_NAME, "{1} / {2} ({3})", FF_MEMORY_NUM_FORMAT_ARGS, ((const char* []) {
"Used size",
"Total size",
"Percentage used"
});
"Percentage used",
}));
}
void ffInitMemoryOptions(FFMemoryOptions* options)