MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / HelpApp

Class HelpApp

tests/test_cmd2.py:1307–1345  ·  view source on GitHub ↗

Class for testing custom help_* methods which override docstring help.

Source from the content-addressed store, hash-verified

1305
1306
1307class HelpApp(cmd2.Cmd):
1308 """Class for testing custom help_* methods which override docstring help."""
1309
1310 DEFAULT_CATEGORY = "My Default Category."
1311 MISC_HEADER = "Various topics found here."
1312
1313 def __init__(self, *args, **kwargs) -> None:
1314 super().__init__(*args, **kwargs)
1315 self.doc_leader = "I now present you with a list of help topics."
1316
1317 def do_squat(self, arg) -> None:
1318 """This docstring help will never be shown because the help_squat method overrides it."""
1319
1320 def help_squat(self) -> None:
1321 self.stdout.write("This command does diddly squat...\n")
1322
1323 def do_edit(self, arg) -> None:
1324 """This overrides the edit command and does nothing."""
1325
1326 # This command has no help text
1327 def do_no_help(self, arg) -> None:
1328 pass
1329
1330 def do_multiline_docstr(self, arg) -> None:
1331 """This documentation
1332 is multiple lines
1333 and there are no
1334 tabs
1335 """
1336
1337 def help_physics(self):
1338 """A miscellaneous help topic."""
1339 self.poutput("Here is some help on physics.")
1340
1341 parser_cmd_parser = cmd2.Cmd2ArgumentParser(description="This is the description.")
1342
1343 @cmd2.with_argparser(parser_cmd_parser)
1344 def do_parser_cmd(self, args) -> None:
1345 """This is the docstring."""
1346
1347
1348@pytest.fixture

Callers 4

help_appFunction · 0.85
test_help_headersFunction · 0.85
test_columnizeFunction · 0.85

Calls

no outgoing calls

Tested by 4

help_appFunction · 0.68
test_help_headersFunction · 0.68
test_columnizeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…