diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-03-04 22:52:17 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-04 22:52:17 -0500 |
commit | 04eac4bc45d5c811e2d54113a03f1ee546901e06 (patch) | |
tree | 0f664834a86d6543287cf89ace609f3c0b3ae535 /examples/arg_print.py | |
parent | dddf5d03c6aa9d7a4f6e953fe1529fa3d7743e39 (diff) | |
parent | d1a970bc5853aa6c1c52db923fb9b4d12ada7cf2 (diff) | |
download | cmd2-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-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') |