Merge "Print help on help command"

This commit is contained in:
Jenkins 2015-06-03 20:58:34 +00:00 committed by Gerrit Code Review
commit b4299e7246
2 changed files with 5 additions and 2 deletions

View File

@ -78,6 +78,7 @@ class HelpCommand(Command):
)
cmd_parser = cmd.get_parser(full_name)
else:
cmd_parser = self.get_parser(' '.join([self.app.NAME, 'help']))
action = HelpAction(None, None, default=self.app)
action(self.app.parser, self.app.parser, None, None)
cmd_parser.print_help(self.app.stdout)
return 0

View File

@ -89,7 +89,9 @@ def test_show_help_for_help():
except SystemExit:
pass
help_text = stdout.getvalue()
assert 'usage: test help [-h]' in help_text
assert 'usage: nosetests [--version]' in help_text
assert 'optional arguments:\n --version' in help_text
assert 'one \n three word command \n' in help_text
def test_list_deprecated_commands():