summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Hellmann <doug.hellmann@dreamhost.com>2012-04-26 16:25:33 -0400
committerDoug Hellmann <doug.hellmann@dreamhost.com>2012-04-26 16:25:33 -0400
commit07ab0cdfc6a356110414e80b4badd6ef469e3797 (patch)
treeb3c683de5729fc67f6323c8c5064c1222d44ba2f
parentc7002526d0b5009049c8f9a70ce9020035026b50 (diff)
downloadcliff-tablib-07ab0cdfc6a356110414e80b4badd6ef469e3797.tar.gz
only show the one-line description in the command list; add a description of "help"
-rw-r--r--cliff/help.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/cliff/help.py b/cliff/help.py
index f53e61b..905f968 100644
--- a/cliff/help.py
+++ b/cliff/help.py
@@ -19,11 +19,15 @@ class HelpAction(argparse.Action):
for name, ep in sorted(command_manager):
factory = ep.load()
cmd = factory(self, None)
- print(' %-13s %s' % (name, cmd.get_description()))
+ one_liner = cmd.get_description().split('\n')[0]
+ print(' %-13s %s' % (name, one_liner))
sys.exit(0)
class HelpCommand(Command):
+ """print detailed help for another command
+ """
+
def get_parser(self, prog_name):
parser = super(HelpCommand, self).get_parser(prog_name)
parser.add_argument('cmd',