From 4e713df66dd4e033968f7866bd5779e14a932b1b Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Tue, 13 May 2008 13:41:41 +0000 Subject: [PATCH] CLI: retry: remove command opts/args in "gnt-X" This new version of the patch removes only the listing of the usage in the "gnt-X" list, but keeps the strings in since we'll want to enhance and use them in "gnt-X $cmd --help". Reviewed-by: ultrotter --- lib/cli.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/cli.py b/lib/cli.py index 5e75da6d2..99031920f 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -251,16 +251,15 @@ def _ParseArgs(argv, commands, aliases): "\n%(bin)s <command> --help to see details, or" " man %(bin)s\n" % {"bin": binary}) # compute the max line length for cmd + usage - mlen = max([len(" %s %s" % (cmd, commands[cmd][3])) for cmd in commands]) + mlen = max([len(" %s" % cmd) for cmd in commands]) mlen = min(60, mlen) # should not get here... # and format a nice command list print "Commands:" for cmd in sortedcmds: - cmdstr = " %s %s" % (cmd, commands[cmd][3]) + cmdstr = " %s" % (cmd,) help_text = commands[cmd][4] help_lines = textwrap.wrap(help_text, 79-3-mlen) - print "%-*s - %s" % (mlen, cmdstr, - help_lines.pop(0)) + print "%-*s - %s" % (mlen, cmdstr, help_lines.pop(0)) for line in help_lines: print "%-*s %s" % (mlen, "", line) print -- GitLab