linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v3 5/5] client: prettify help table
Date: Fri, 21 Jun 2013 11:17:35 -0300	[thread overview]
Message-ID: <1371824255-3071-5-git-send-email-lucas.demarchi@profusion.mobi> (raw)
In-Reply-To: <1371824255-3071-1-git-send-email-lucas.demarchi@profusion.mobi>

From: Lucas De Marchi <lucas.demarchi@intel.com>

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.
---
 client/main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/client/main.c b/client/main.c
index ff2afc6..0dd1510 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:
-- 
1.8.3.1


  parent reply	other threads:[~2013-06-21 14:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-21 14:17 [PATCH BlueZ v3 1/5] build-sys: Don't build gdbus several times Lucas De Marchi
2013-06-21 14:17 ` [PATCH BlueZ v3 2/5] gitignore: Add missing tools Lucas De Marchi
2013-06-21 14:17 ` [PATCH BlueZ v3 3/5] adapter: Remove never used parameter Lucas De Marchi
2013-06-21 14:17 ` [PATCH BlueZ v3 4/5] client: Add description for default-agent command Lucas De Marchi
2013-06-21 14:17 ` Lucas De Marchi [this message]
2013-06-24  8:14   ` [PATCH BlueZ v3 5/5] client: prettify help table Johan Hedberg
2013-06-21 22:02 ` [PATCH BlueZ v3 1/5] build-sys: Don't build gdbus several times Marcel Holtmann
2013-06-21 22:37   ` Lucas De Marchi
2013-06-21 22:47     ` Marcel Holtmann
2013-06-25 18:50       ` Lucas De Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1371824255-3071-5-git-send-email-lucas.demarchi@profusion.mobi \
    --to=lucas.demarchi@profusion.mobi \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).