File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -62,10 +62,18 @@ static void printCommandFormatHelp(const char* command) {
6262 puts ("To see how a format string is constructed, take a look at https://github.com/fastfetch-cli/fastfetch/wiki/Format-String-Guide." );
6363 puts ("The following variables are passed:" );
6464
65+ uint32_t maxWidth = 20 ;
66+ for (unsigned i = 0 ; i < baseInfo -> formatArgs .count ; i ++ ) {
67+ uint32_t len = (uint32_t ) strlen (baseInfo -> formatArgs .args [i ].name ) + 2 ;
68+ if (len > maxWidth ) {
69+ maxWidth = len ;
70+ }
71+ }
72+
6573 for (unsigned i = 0 ; i < baseInfo -> formatArgs .count ; i ++ ) {
6674 const FFModuleFormatArg * arg = & baseInfo -> formatArgs .args [i ];
6775 ffStrbufSetF (& variable , "{%s}" , arg -> name );
68- printf ("%20s : %s\n" , variable .chars , arg -> desc );
76+ printf ("%*s : %s\n" , ( int ) maxWidth , variable .chars , arg -> desc );
6977 }
7078 } else {
7179 fprintf (stderr , "Error: Module '%s' doesn't support output formatting\n" , baseInfo -> name );
You can’t perform that action at this time.
0 commit comments