diff options
author | Doug Hellmann <doug.hellmann@dreamhost.com> | 2012-04-26 16:25:33 -0400 |
---|---|---|
committer | Doug Hellmann <doug.hellmann@dreamhost.com> | 2012-04-26 16:25:33 -0400 |
commit | 07ab0cdfc6a356110414e80b4badd6ef469e3797 (patch) | |
tree | b3c683de5729fc67f6323c8c5064c1222d44ba2f | |
parent | c7002526d0b5009049c8f9a70ce9020035026b50 (diff) | |
download | cliff-tablib-07ab0cdfc6a356110414e80b4badd6ef469e3797.tar.gz |
only show the one-line description in the command list; add a description of "help"
-rw-r--r-- | cliff/help.py | 6 |
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', |