diff options
Diffstat (limited to 'examples/modular_commands/commandset_basic.py')
-rw-r--r-- | examples/modular_commands/commandset_basic.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/modular_commands/commandset_basic.py b/examples/modular_commands/commandset_basic.py index 105530e8..2ceda439 100644 --- a/examples/modular_commands/commandset_basic.py +++ b/examples/modular_commands/commandset_basic.py @@ -30,7 +30,7 @@ class BasicCompletionCommandSet(CommandSet): -s, --sport [completes sports] -p, --path [completes local file system paths] """ - cmd.poutput("Args: {}".format(statement.args)) + self._cmd.poutput("Args: {}".format(statement.args)) def complete_flag_based(self, cmd: Cmd, text: str, line: str, begidx: int, endidx: int) -> List[str]: """Completion function for do_flag_based""" @@ -53,7 +53,7 @@ class BasicCompletionCommandSet(CommandSet): def do_index_based(self, cmd: Cmd, statement: Statement): """Tab completes first 3 arguments using index_based_complete""" - cmd.poutput("Args: {}".format(statement.args)) + self._cmd.poutput("Args: {}".format(statement.args)) def complete_index_based(self, cmd: Cmd, text: str, line: str, begidx: int, endidx: int) -> List[str]: """Completion function for do_index_based""" @@ -68,14 +68,14 @@ class BasicCompletionCommandSet(CommandSet): def do_delimiter_complete(self, cmd: Cmd, statement: Statement): """Tab completes files from a list using delimiter_complete""" - cmd.poutput("Args: {}".format(statement.args)) + self._cmd.poutput("Args: {}".format(statement.args)) def complete_delimiter_complete(self, cmd: Cmd, text: str, line: str, begidx: int, endidx: int) -> List[str]: return cmd.delimiter_complete(text, line, begidx, endidx, match_against=self.file_strs, delimiter='/') def do_raise_error(self, cmd: Cmd, statement: Statement): """Demonstrates effect of raising CompletionError""" - cmd.poutput("Args: {}".format(statement.args)) + self._cmd.poutput("Args: {}".format(statement.args)) def complete_raise_error(self, cmd: Cmd, text: str, line: str, begidx: int, endidx: int) -> List[str]: """ @@ -89,4 +89,4 @@ class BasicCompletionCommandSet(CommandSet): @with_category('Not Basic Completion') def do_custom_category(self, cmd: Cmd, statement: Statement): - cmd.poutput('Demonstrates a command that bypasses the default category') + self._cmd.poutput('Demonstrates a command that bypasses the default category') |