summaryrefslogtreecommitdiff
path: root/examples/arg_print.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2019-03-04 22:52:17 -0500
committerGitHub <noreply@github.com>2019-03-04 22:52:17 -0500
commit04eac4bc45d5c811e2d54113a03f1ee546901e06 (patch)
tree0f664834a86d6543287cf89ace609f3c0b3ae535 /examples/arg_print.py
parentdddf5d03c6aa9d7a4f6e953fe1529fa3d7743e39 (diff)
parentd1a970bc5853aa6c1c52db923fb9b4d12ada7cf2 (diff)
downloadcmd2-git-04eac4bc45d5c811e2d54113a03f1ee546901e06.tar.gz
Merge pull request #636 from python-cmd2/with_argument_list
Fix bug in with_argument_list decorator
Diffstat (limited to 'examples/arg_print.py')
-rwxr-xr-xexamples/arg_print.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/arg_print.py b/examples/arg_print.py
index 1a103858..18d21787 100755
--- a/examples/arg_print.py
+++ b/examples/arg_print.py
@@ -38,6 +38,11 @@ class ArgumentAndOptionPrinter(cmd2.Cmd):
"""Print the argument list this basic command is called with."""
self.poutput('lprint was called with the following list of arguments: {!r}'.format(arglist))
+ @cmd2.with_argument_list(preserve_quotes=True)
+ def do_rprint(self, arglist):
+ """Print the argument list this basic command is called with (with quotes preserved)."""
+ self.poutput('rprint was called with the following list of arguments: {!r}'.format(arglist))
+
oprint_parser = argparse.ArgumentParser()
oprint_parser.add_argument('-p', '--piglatin', action='store_true', help='atinLay')
oprint_parser.add_argument('-s', '--shout', action='store_true', help='N00B EMULATION MODE')