summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-07-11 13:53:45 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-07-11 13:53:45 -0400
commit6cf0237abda400d60dad8fa42a22a927e943d0eb (patch)
treee5e6b1bad4f90566e329dff62d1590cb00df8a84 /examples
parentca89266546d93b993cc3e48935b62de08332c3a0 (diff)
parent8109e70b0442206103fa5fe1a3af79d1851d7ec1 (diff)
downloadcmd2-git-6cf0237abda400d60dad8fa42a22a927e943d0eb.tar.gz
Merge branch 'master' into auto_completer_refactor
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/hooks.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/hooks.py b/examples/hooks.py
index acd427cd..409c8979 100755
--- a/examples/hooks.py
+++ b/examples/hooks.py
@@ -61,7 +61,7 @@ class CmdLineApp(cmd2.Cmd):
command_pattern = re.compile(r'^([^\s\d]+)(\d+)')
match = command_pattern.search(command)
if match:
- data.statement = self._statement_parser.parse("{} {} {}".format(
+ data.statement = self.statement_parser.parse("{} {} {}".format(
match.group(1),
match.group(2),
'' if data.statement.args is None else data.statement.args
@@ -71,7 +71,7 @@ class CmdLineApp(cmd2.Cmd):
def downcase_hook(self, data: cmd2.plugin.PostparsingData) -> cmd2.plugin.PostparsingData:
"""A hook to make uppercase commands lowercase."""
command = data.statement.command.lower()
- data.statement = self._statement_parser.parse("{} {}".format(
+ data.statement = self.statement_parser.parse("{} {}".format(
command,
'' if data.statement.args is None else data.statement.args
))
@@ -85,7 +85,7 @@ class CmdLineApp(cmd2.Cmd):
possible_cmds = [cmd for cmd in self.get_all_commands() if cmd.startswith(data.statement.command)]
if len(possible_cmds) == 1:
raw = data.statement.raw.replace(data.statement.command, possible_cmds[0], 1)
- data.statement = self._statement_parser.parse(raw)
+ data.statement = self.statement_parser.parse(raw)
return data
@cmd2.with_argument_list