h(elp) Without argument, print the list of available commands. With a command name as argument, print help about that command. "help pdb" shows the full pdb documentation. "help exec" gives help on the ! command.
(self, arg)
| 2485 | # Provide help |
| 2486 | |
| 2487 | def do_help(self, arg): |
| 2488 | """h(elp) |
| 2489 | |
| 2490 | Without argument, print the list of available commands. |
| 2491 | With a command name as argument, print help about that command. |
| 2492 | "help pdb" shows the full pdb documentation. |
| 2493 | "help exec" gives help on the ! command. |
| 2494 | """ |
| 2495 | if not arg: |
| 2496 | return cmd.Cmd.do_help(self, arg) |
| 2497 | try: |
| 2498 | try: |
| 2499 | topic = getattr(self, 'help_' + arg) |
| 2500 | return topic() |
| 2501 | except AttributeError: |
| 2502 | command = getattr(self, 'do_' + arg) |
| 2503 | except AttributeError: |
| 2504 | self.error('No help for %r' % arg) |
| 2505 | else: |
| 2506 | if sys.flags.optimize >= 2: |
| 2507 | self.error('No help for %r; please do not run Python with -OO ' |
| 2508 | 'if you need command help' % arg) |
| 2509 | return |
| 2510 | if command.__doc__ is None: |
| 2511 | self.error('No help for %r; __doc__ string missing' % arg) |
| 2512 | return |
| 2513 | self.message(self._help_message_from_doc(command.__doc__)) |
| 2514 | |
| 2515 | do_h = do_help |
| 2516 |
no test coverage detected