summaryrefslogtreecommitdiff
path: root/examples/arg_print.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-12-06 13:40:58 -0500
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-12-06 13:40:58 -0500
commit5b9281f6dfb55d436e6a19ae41af5a8590fbaed7 (patch)
tree6b4d269801df6fb2634af3003fe28a29b010008f /examples/arg_print.py
parent23970dfdca765992157b8089f3a34f7fd4fa4f10 (diff)
parentea182bbea386288b1acfbc35c99243a457ff1036 (diff)
downloadcmd2-git-5b9281f6dfb55d436e6a19ae41af5a8590fbaed7.tar.gz
Merge branch 'master' into history
Diffstat (limited to 'examples/arg_print.py')
-rwxr-xr-xexamples/arg_print.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/arg_print.py b/examples/arg_print.py
index f2168126..1a103858 100755
--- a/examples/arg_print.py
+++ b/examples/arg_print.py
@@ -13,6 +13,7 @@ import argparse
import cmd2
+
class ArgumentAndOptionPrinter(cmd2.Cmd):
""" Example cmd2 application where we create commands that just print the arguments they are called with."""
@@ -52,6 +53,7 @@ class ArgumentAndOptionPrinter(cmd2.Cmd):
pprint_parser.add_argument('-p', '--piglatin', action='store_true', help='atinLay')
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)
def do_pprint(self, args, unknown):
"""Print the options and argument list this options command was called with."""