diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-06-11 17:39:11 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-06-11 17:39:11 -0400 |
commit | 77633bc4498d6f11b07ea0a3bd13d4830f809ff8 (patch) | |
tree | 037879fb49353ac66a5d2a3e6c74f0cb3a3b0dd2 /examples | |
parent | 1aee0316973873e8967679f6778952c1d696866a (diff) | |
download | cmd2-git-77633bc4498d6f11b07ea0a3bd13d4830f809ff8.tar.gz |
Removed support for cmd.cmdqueue
allow_cli_args is now an argument to __init__ instead of a cmd2 class member
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/cmd_as_argument.py | 3 | ||||
-rwxr-xr-x | examples/decorator_example.py | 3 | ||||
-rwxr-xr-x | examples/persistent_history.py | 3 |
3 files changed, 2 insertions, 7 deletions
diff --git a/examples/cmd_as_argument.py b/examples/cmd_as_argument.py index 9eb0befb..538feac1 100755 --- a/examples/cmd_as_argument.py +++ b/examples/cmd_as_argument.py @@ -31,9 +31,8 @@ class CmdLineApp(cmd2.Cmd): shortcuts = dict(self.DEFAULT_SHORTCUTS) shortcuts.update({'&': 'speak'}) # Set use_ipython to True to enable the "ipy" command which embeds and interactive IPython shell - super().__init__(use_ipython=False, multiline_commands=['orate'], shortcuts=shortcuts) + super().__init__(allow_cli_args=False, use_ipython=False, multiline_commands=['orate'], shortcuts=shortcuts) - self.allow_cli_args = False self.maxrepeats = 3 # Make maxrepeats settable at runtime self.settable['maxrepeats'] = 'max repetitions for speak command' diff --git a/examples/decorator_example.py b/examples/decorator_example.py index e268c615..bb0d58c0 100755 --- a/examples/decorator_example.py +++ b/examples/decorator_example.py @@ -29,9 +29,6 @@ class CmdLineApp(cmd2.Cmd): # Make maxrepeats settable at runtime self.settable['maxrepeats'] = 'Max number of `--repeat`s allowed' - # Disable cmd's usage of command-line arguments as commands to be run at invocation - # self.allow_cli_args = False - # Example of args set from the command-line (but they aren't being used here) self._ip = ip_addr self._port = port diff --git a/examples/persistent_history.py b/examples/persistent_history.py index 12d8b813..e88fd5d9 100755 --- a/examples/persistent_history.py +++ b/examples/persistent_history.py @@ -15,8 +15,7 @@ class Cmd2PersistentHistory(cmd2.Cmd): :param hist_file: file to load readline history from at start and write it to at end """ - super().__init__(persistent_history_file=hist_file, persistent_history_length=500) - self.allow_cli_args = False + super().__init__(persistent_history_file=hist_file, persistent_history_length=500, allow_cli_args=False) self.prompt = 'ph> ' # ... your class code here ... |