cmd + options have a maximum length of 25. Align the description
after this value. In order not to reach 80 chars so easily change the
first \t to 2 spaces, like is done in udev, kmod, systemd, etc.
for (i = 0; cmd_table[i].cmd; i++) {
if (cmd_table[i].desc)
- printf("\t%s %s\t%s\n", cmd_table[i].cmd,
- cmd_table[i].arg ? : " ",
- cmd_table[i].desc);
+ printf(" %s %-*s %s\n", cmd_table[i].cmd,
+ (int)(25 - strlen(cmd_table[i].cmd)),
+ cmd_table[i].arg ? : "",
+ cmd_table[i].desc ? : "");
}
done: