diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-03-04 20:40:28 -0500 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-03-04 20:40:28 -0500 |
commit | 28e44aac56ea21be8aa3bea5d93325d0edd836be (patch) | |
tree | 434e64307f030ed5a62c062943c694b782ef85f9 /examples | |
parent | de701086ff832bad0f0d97ffb10c2159d56ede7d (diff) | |
download | cmd2-git-28e44aac56ea21be8aa3bea5d93325d0edd836be.tar.gz |
Fix for when with_argument_list is called with preserve_quotes optional argument
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/arg_print.py | 5 |
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') |