summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/arg_print.py2
-rw-r--r--examples/modular_commands/commandset_complex.py2
-rwxr-xr-xexamples/python_scripting.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/examples/arg_print.py b/examples/arg_print.py
index 3f7f3815..dbf740ff 100755
--- a/examples/arg_print.py
+++ b/examples/arg_print.py
@@ -56,7 +56,7 @@ class ArgumentAndOptionPrinter(cmd2.Cmd):
pprint_parser.add_argument('-s', '--shout', action='store_true', help='N00B EMULATION MODE')
pprint_parser.add_argument('-r', '--repeat', type=int, help='output [n] times')
- @cmd2.with_argparser_and_unknown_args(pprint_parser)
+ @cmd2.with_argparser(pprint_parser, with_unknown_args=True)
def do_pprint(self, args, unknown):
"""Print the options and argument list this options command was called with."""
self.poutput('oprint was called with the following\n\toptions: {!r}\n\targuments: {}'.format(args, unknown))
diff --git a/examples/modular_commands/commandset_complex.py b/examples/modular_commands/commandset_complex.py
index 5a031bd0..ec5a9e13 100644
--- a/examples/modular_commands/commandset_complex.py
+++ b/examples/modular_commands/commandset_complex.py
@@ -23,7 +23,7 @@ class CommandSetA(cmd2.CommandSet):
cranberry_parser = cmd2.Cmd2ArgumentParser('cranberry')
cranberry_parser.add_argument('arg1', choices=['lemonade', 'juice', 'sauce'])
- @cmd2.with_argparser_and_unknown_args(cranberry_parser)
+ @cmd2.with_argparser(cranberry_parser, with_unknown_args=True)
def do_cranberry(self, cmd: cmd2.Cmd, ns: argparse.Namespace, unknown: List[str]):
cmd.poutput('Cranberry {}!!'.format(ns.arg1))
if unknown and len(unknown):
diff --git a/examples/python_scripting.py b/examples/python_scripting.py
index 69cfb672..6e4295d4 100755
--- a/examples/python_scripting.py
+++ b/examples/python_scripting.py
@@ -96,7 +96,7 @@ class CmdLineApp(cmd2.Cmd):
dir_parser = argparse.ArgumentParser()
dir_parser.add_argument('-l', '--long', action='store_true', help="display in long format with one item per line")
- @cmd2.with_argparser_and_unknown_args(dir_parser)
+ @cmd2.with_argparser(dir_parser, with_unknown_args=True)
def do_dir(self, args, unknown):
"""List contents of current directory."""
# No arguments for this command