summaryrefslogtreecommitdiff
path: root/examples/arg_print.py
diff options
context:
space:
mode:
authorkotfu <jared@kotfu.net>2018-05-02 20:27:14 -0600
committerGitHub <noreply@github.com>2018-05-02 20:27:14 -0600
commit6b5c23c127e78ca4f9e30a1cbea76c61f10e418c (patch)
tree07ebf6b0b51227800b287a6d26d1951d449cbde6 /examples/arg_print.py
parentd37004d05d0be67f48f35d6986ea899a35bcf89f (diff)
parentfa94eed90cf81b24e5b83c2b4c7e16025d849996 (diff)
downloadcmd2-git-6b5c23c127e78ca4f9e30a1cbea76c61f10e418c.tar.gz
Merge pull request #370 from python-cmd2/ply
Switch parsing logic from pyparsing to shlex
Diffstat (limited to 'examples/arg_print.py')
-rwxr-xr-xexamples/arg_print.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/examples/arg_print.py b/examples/arg_print.py
index 90df053a..b2f0fcda 100755
--- a/examples/arg_print.py
+++ b/examples/arg_print.py
@@ -19,16 +19,13 @@ class ArgumentAndOptionPrinter(cmd2.Cmd):
""" Example cmd2 application where we create commands that just print the arguments they are called with."""
def __init__(self):
- # Uncomment this line to disable Python-style comments but still allow C-style comments
- # self.commentGrammars = pyparsing.Or([pyparsing.cStyleComment])
-
# Create command aliases which are shorter
self.shortcuts.update({'$': 'aprint', '%': 'oprint'})
- # Make sure to call this super class __init__ *after* setting commentGrammars and/or updating shortcuts
+ # 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 commentGrammars, shortcuts, multilineCommands, etc.
+ # are not settable at runtime. This includes the shortcuts, multiline_commands, etc.
def do_aprint(self, arg):
"""Print the argument string this basic command is called with."""