diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2013-06-21 11:17:35 -0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-06-24 11:12:59 +0300 |
commit | 9d2e019fe39495e4645504e965069a2214046252 (patch) | |
tree | 31fe7a659d9b3b0593d3cd84d31ce93ab2b8c99a /client | |
parent | e9150410ec356fa7196b4463f5abf05393d9ee75 (diff) |
client: prettify help table
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.
Diffstat (limited to 'client')
-rw-r--r-- | client/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/client/main.c b/client/main.c index ff2afc677..0dd151072 100644 --- a/client/main.c +++ b/client/main.c @@ -1184,9 +1184,10 @@ static void rl_handler(char *input) 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: |