diff options
author | Amerigo Wang <amwang@redhat.com> | 2009-12-14 03:23:56 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-28 03:03:16 -0500 |
commit | 3912f2abc942a002ef611fc973add5e5eadb3432 (patch) | |
tree | 41972a146e2f5d25b36429611fa53108fc8edd69 /tools/perf/builtin-help.c | |
parent | 049ae80b8790bd3c150d78e3351dcc491e9f2416 (diff) |
perf: Use format string of printf to align strings
Instead of filling whitespaces to do alignment, use
printf's format string.
This simplifies the code a bit.
Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20091214082700.4224.57640.sendpatchset@localhost.localdomain>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-help.c')
-rw-r--r-- | tools/perf/builtin-help.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c index 9f810b17c25c..e427d6965e0c 100644 --- a/tools/perf/builtin-help.c +++ b/tools/perf/builtin-help.c | |||
@@ -286,8 +286,7 @@ void list_common_cmds_help(void) | |||
286 | 286 | ||
287 | puts(" The most commonly used perf commands are:"); | 287 | puts(" The most commonly used perf commands are:"); |
288 | for (i = 0; i < ARRAY_SIZE(common_cmds); i++) { | 288 | for (i = 0; i < ARRAY_SIZE(common_cmds); i++) { |
289 | printf(" %s ", common_cmds[i].name); | 289 | printf(" %-*s ", longest, common_cmds[i].name); |
290 | mput_char(' ', longest - strlen(common_cmds[i].name)); | ||
291 | puts(common_cmds[i].help); | 290 | puts(common_cmds[i].help); |
292 | } | 291 | } |
293 | } | 292 | } |