Print help on help command
Change it so that 'cliffdemo help' prints the full help, not the help for the help command. 'cliffdemo help help' can be used to print the help for the help command. Running 'cliffdemo help' will be similar to running 'cliffdemo --help'. Change-Id: I1b3e5448b2cf357ae65ca86e1131165aff023c39
This commit is contained in:
@@ -78,6 +78,7 @@ class HelpCommand(Command):
|
|||||||
)
|
)
|
||||||
cmd_parser = cmd.get_parser(full_name)
|
cmd_parser = cmd.get_parser(full_name)
|
||||||
else:
|
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)
|
cmd_parser.print_help(self.app.stdout)
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -90,7 +90,9 @@ def test_show_help_for_help():
|
|||||||
except SystemExit:
|
except SystemExit:
|
||||||
pass
|
pass
|
||||||
help_text = stdout.getvalue()
|
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():
|
def test_list_deprecated_commands():
|
||||||
|
|||||||
Reference in New Issue
Block a user