diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-06-14 18:12:39 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-06-14 18:12:39 -0400 |
commit | 85dbe035114330a15abd5af6e098ef6948fa6cb0 (patch) | |
tree | e087dfa160eba882dcbd623609cab763efbd1ebc /examples | |
parent | 3329e5fec21f2cc4479bb3358170e2226885ab3b (diff) | |
parent | ddd07f9cd6d72baca1232ae98856cf3b3d564706 (diff) | |
download | cmd2-git-85dbe035114330a15abd5af6e098ef6948fa6cb0.tar.gz |
Merge branch 'master' into history_fixes
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 | ||||
-rw-r--r-- | examples/scripts/quit.txt | 1 | ||||
-rwxr-xr-x | examples/tab_autocomp_dynamic.py | 3 | ||||
-rwxr-xr-x | examples/tab_autocompletion.py | 3 | ||||
-rw-r--r-- | examples/transcripts/quit.txt | 1 |
7 files changed, 4 insertions, 13 deletions
diff --git a/examples/cmd_as_argument.py b/examples/cmd_as_argument.py index bd7f00cb..1e7901b9 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=True, multiline_commands=['orate'], shortcuts=shortcuts) + super().__init__(allow_cli_args=False, use_ipython=True, multiline_commands=['orate'], shortcuts=shortcuts) - self.allow_cli_args = False self.locals_in_py = True self.maxrepeats = 3 # Make maxrepeats settable at runtime 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 ... diff --git a/examples/scripts/quit.txt b/examples/scripts/quit.txt new file mode 100644 index 00000000..ff604669 --- /dev/null +++ b/examples/scripts/quit.txt @@ -0,0 +1 @@ +quit diff --git a/examples/tab_autocomp_dynamic.py b/examples/tab_autocomp_dynamic.py index 03e46f8a..b518c013 100755 --- a/examples/tab_autocomp_dynamic.py +++ b/examples/tab_autocomp_dynamic.py @@ -2,9 +2,6 @@ # coding=utf-8 """ A example usage of AutoCompleter with delayed initialization of the argparse object - -Copyright 2018 Eric Lin <anselor@gmail.com> -Released under MIT license, see LICENSE file """ from typing import List diff --git a/examples/tab_autocompletion.py b/examples/tab_autocompletion.py index 6883c423..8f27cb90 100755 --- a/examples/tab_autocompletion.py +++ b/examples/tab_autocompletion.py @@ -2,9 +2,6 @@ # coding=utf-8 """ A example usage of the AutoCompleter - -Copyright 2018 Eric Lin <anselor@gmail.com> -Released under MIT license, see LICENSE file """ import argparse import itertools diff --git a/examples/transcripts/quit.txt b/examples/transcripts/quit.txt new file mode 100644 index 00000000..6dcf8c66 --- /dev/null +++ b/examples/transcripts/quit.txt @@ -0,0 +1 @@ +(Cmd) quit |