Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/fastfetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,18 @@ static void printCommandFormatHelp(const char* command) {
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:");

uint32_t maxWidth = 20;
for (unsigned i = 0; i < baseInfo->formatArgs.count; i++) {
uint32_t len = (uint32_t) strlen(baseInfo->formatArgs.args[i].name) + 2;
if (len > maxWidth) {
maxWidth = len;
}
}

for (unsigned i = 0; i < baseInfo->formatArgs.count; i++) {
const FFModuleFormatArg* arg = &baseInfo->formatArgs.args[i];
ffStrbufSetF(&variable, "{%s}", arg->name);
printf("%20s: %s\n", variable.chars, arg->desc);
printf("%*s: %s\n", (int) maxWidth, variable.chars, arg->desc);
}
} else {
fprintf(stderr, "Error: Module '%s' doesn't support output formatting\n", baseInfo->name);
Expand Down
10 changes: 5 additions & 5 deletions src/modules/zpool/zpool.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,15 @@ FFModuleBaseInfo ffZpoolModuleInfo = {
{ "Zpool name", "name" },
{ "Zpool guid", "guid" },
{ "Zpool state", "state" },
{ "Size used", "used" },
{ "Size allocated", "allocated" },
{ "Size total", "total" },
{ "Size used", "size-used" },
{ "Size allocated", "size-allocated" },
{ "Size total", "size-total" },
{ "Size used percentage num", "used-percentage" },
{ "Size allocated percentage num", "allocated-percentage" },
{ "Fragmentation percentage num", "fragmentation-percentage" },
{ "Fragmentation percentage num", "frag-percentage" },
{ "Size used percentage bar", "used-percentage-bar" },
{ "Size allocated percentage bar", "allocated-percentage-bar" },
{ "Fragmentation percentage bar", "fragmentation-percentage-bar" },
{ "Fragmentation percentage bar", "frag-percentage-bar" },
{ "Is read-only", "is-readonly" },
}))
};
Loading