summaryrefslogtreecommitdiff
path: root/examples/arg_print.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2019-03-18 22:49:42 -0400
committerGitHub <noreply@github.com>2019-03-18 22:49:42 -0400
commit2f24a8ad3eeb2fdf699d1e2a9d4f05429fe879c4 (patch)
treeb836270cf61175d1e4a434fd8cae08f0ffd998a2 /examples/arg_print.py
parent96d176cc3d8198913693a42c7dd983cf69a165bd (diff)
parent57dd827963491439e40eb5dfe20811c14ea757ff (diff)
downloadcmd2-git-2f24a8ad3eeb2fdf699d1e2a9d4f05429fe879c4.tar.gz
Merge branch 'master' into load_generate_transcript
Diffstat (limited to 'examples/arg_print.py')
-rwxr-xr-xexamples/arg_print.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/examples/arg_print.py b/examples/arg_print.py
index 18d21787..edcc8444 100755
--- a/examples/arg_print.py
+++ b/examples/arg_print.py
@@ -19,12 +19,9 @@ class ArgumentAndOptionPrinter(cmd2.Cmd):
def __init__(self):
# Create command shortcuts which are typically 1 character abbreviations which can be used in place of a command
- self.shortcuts.update({'$': 'aprint', '%': 'oprint'})
-
- # Make sure to call this super class __init__ *after* setting and/or updating shortcuts
- super().__init__()
- # NOTE: It is critical that the super class __init__ method be called AFTER updating certain parameters which
- # are not settable at runtime. This includes the shortcuts, multiline_commands, etc.
+ shortcuts = dict(self.DEFAULT_SHORTCUTS)
+ shortcuts.update({'$': 'aprint', '%': 'oprint'})
+ super().__init__(shortcuts=shortcuts)
def do_aprint(self, statement):
"""Print the argument string this basic command is called with."""