Commit 4e713df6 authored by Iustin Pop's avatar Iustin Pop
Browse files

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
parent 9a033156
......@@ -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,
print "%-*s - %s" % (mlen, cmdstr, help_lines.pop(0))
for line in help_lines:
print "%-*s %s" % (mlen, "", line)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment