Skip to content

Commit 64da80d

Browse files
committed
Fastfetch: improves format help output for config and variables
Fixes #1927
1 parent 8b1bfcb commit 64da80d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/fastfetch.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,17 @@ static void printCommandFormatHelp(const char* command)
6565
{
6666
if (baseInfo->formatArgs.count > 0)
6767
{
68-
printf("--%s-format:\n", type.chars);
68+
FF_STRBUF_AUTO_DESTROY variable = ffStrbufCreate();
69+
printf("-- In config file: { \"type\": \"%s\", \"format\": \"{<format-variable>}\" }\n", type.chars);
6970
printf("Sets the format string for %s output.\n", baseInfo->name);
70-
puts("To see how a format string is constructed, take a look at \"fastfetch --help format\".");
71-
puts("The following values are passed:");
71+
puts("To see how a format string is constructed, take a look at https://github.com/fastfetch-cli/fastfetch/wiki/Format-String-Guide.");
72+
puts("The following variables are passed:");
7273

7374
for (unsigned i = 0; i < baseInfo->formatArgs.count; i++)
7475
{
7576
const FFModuleFormatArg* arg = &baseInfo->formatArgs.args[i];
76-
printf("%16s {%u}: %s\n", arg->name, i + 1, arg->desc);
77+
ffStrbufSetF(&variable, "{%s}", arg->name);
78+
printf("%20s: %s\n", variable.chars, arg->desc);
7779
}
7880
}
7981
else

0 commit comments

Comments
 (0)