From 64da80d5209eb1768d8ab30c0bebe5d33c11d096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 21 Aug 2025 23:56:14 +0800 Subject: [PATCH] Fastfetch: improves format help output for config and variables Fixes #1927 --- src/fastfetch.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/fastfetch.c b/src/fastfetch.c index c913b4554..0e12f3286 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -65,15 +65,17 @@ static void printCommandFormatHelp(const char* command) { if (baseInfo->formatArgs.count > 0) { - printf("--%s-format:\n", type.chars); + FF_STRBUF_AUTO_DESTROY variable = ffStrbufCreate(); + printf("-- In config file: { \"type\": \"%s\", \"format\": \"{}\" }\n", type.chars); printf("Sets the format string for %s output.\n", baseInfo->name); - puts("To see how a format string is constructed, take a look at \"fastfetch --help format\"."); - puts("The following values are passed:"); + puts("To see how a format string is constructed, take a look at https://github.com/fastfetch-cli/fastfetch/wiki/Format-String-Guide."); + puts("The following variables are passed:"); for (unsigned i = 0; i < baseInfo->formatArgs.count; i++) { const FFModuleFormatArg* arg = &baseInfo->formatArgs.args[i]; - printf("%16s {%u}: %s\n", arg->name, i + 1, arg->desc); + ffStrbufSetF(&variable, "{%s}", arg->name); + printf("%20s: %s\n", variable.chars, arg->desc); } } else