diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-12-03 20:12:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-03 20:12:37 -0500 |
commit | 895637ce395bfb075180783ceca5ba0acb07ff88 (patch) | |
tree | b588bd1be5300d4b1e37b8c64339c68ae240ae75 | |
parent | fb3486fae7df048c2ff9302ee9bf87fbe43461fb (diff) | |
parent | b025b3927bc514d6603da36f28d04197ec6508a5 (diff) | |
download | cmd2-git-895637ce395bfb075180783ceca5ba0acb07ff88.tar.gz |
Merge pull request #605 from python-cmd2/del_complete_help
Moved some class specific code out of __init__
-rw-r--r-- | cmd2/cmd2.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 012b6f6b..3af6b5e6 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -394,10 +394,6 @@ class Cmd(cmd.Cmd): # Call super class constructor super().__init__(completekey=completekey, stdin=stdin, stdout=stdout) - # Get rid of cmd's complete_help() functions so AutoCompleter will complete our help command - if getattr(cmd.Cmd, 'complete_help', None) is not None: - delattr(cmd.Cmd, 'complete_help') - # Commands to exclude from the help menu and tab completion self.hidden_commands = ['eof', 'eos', '_relative_load'] @@ -2584,6 +2580,10 @@ class Cmd(cmd.Cmd): help_parser.add_argument('-v', '--verbose', action='store_true', help="print a list of all commands with descriptions of each") + # Get rid of cmd's complete_help() functions so AutoCompleter will complete the help command + if getattr(cmd.Cmd, 'complete_help', None) is not None: + delattr(cmd.Cmd, 'complete_help') + @with_argparser(help_parser) def do_help(self, args: argparse.Namespace) -> None: """List available commands or provide detailed help for a specific command""" |