Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/
Date: Sat, 19 Nov 2011 08:11:27
Message-Id: c21c1f1e59a9e1fe8dbab22ebbf3f574a591e6ba.vapier@gentoo
1 commit: c21c1f1e59a9e1fe8dbab22ebbf3f574a591e6ba
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 19 07:39:08 2011 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 19 07:42:41 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=c21c1f1e
7
8 rc: usage: optimize help string alignment output a little
9
10 Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
11
12 ---
13 src/rc/_usage.c | 5 +++--
14 1 files changed, 3 insertions(+), 2 deletions(-)
15
16 diff --git a/src/rc/_usage.c b/src/rc/_usage.c
17 index 1180853..8aa1806 100644
18 --- a/src/rc/_usage.c
19 +++ b/src/rc/_usage.c
20 @@ -75,8 +75,9 @@ usage(int exit_status)
21
22 lo = p = xstrdup(longopts_help[i]);
23 while ((token = strsep(&p, "\n"))) {
24 - while (++len < 37)
25 - printf(" ");
26 + len = 36 - len;
27 + if (len > 0)
28 + printf("%*s", len, "");
29 puts(token);
30 len = 0;
31 }