@@ -55,10 +55,9 @@ method, which will contain the results of ``ArgumentParser.parse_args()``.
5555
5656Here's what it looks like::
5757
58- import argparse
59- from cmd2 import with_argparser
58+ from cmd2 import Cmd2ArgumentParser, with_argparser
6059
61- argparser = argparse.ArgumentParser ()
60+ argparser = Cmd2ArgumentParser ()
6261 argparser.add_argument('-p', '--piglatin', action='store_true', help='atinLay')
6362 argparser.add_argument('-s', '--shout', action='store_true', help='N00B EMULATION MODE')
6463 argparser.add_argument('-r', '--repeat', type=int, help='output [n] times')
@@ -106,10 +105,9 @@ docstring for the ``do_*`` method is used to set the description for the
106105
107106With this code::
108107
109- import argparse
110- from cmd2 import with_argparser
108+ from cmd2 import Cmd2ArgumentParser, with_argparser
111109
112- argparser = argparse.ArgumentParser ()
110+ argparser = Cmd2ArgumentParser ()
113111 argparser.add_argument('tag', help='tag')
114112 argparser.add_argument('content', nargs='+', help='content to surround with tag')
115113 @with_argparser(argparser)
@@ -137,10 +135,9 @@ the ``help tag`` command displays:
137135 If you would prefer you can set the ``description `` while instantiating the
138136``argparse.ArgumentParser `` and leave the docstring on your method empty::
139137
140- import argparse
141- from cmd2 import with_argparser
138+ from cmd2 import Cmd2ArgumentParser, with_argparser
142139
143- argparser = argparse.ArgumentParser (description='create an html tag')
140+ argparser = Cmd2ArgumentParser (description='create an html tag')
144141 argparser.add_argument('tag', help='tag')
145142 argparser.add_argument('content', nargs='+', help='content to surround with tag')
146143 @with_argparser(argparser)
@@ -166,11 +163,10 @@ Now when the user enters ``help tag`` they see:
166163
167164 To add additional text to the end of the generated help message, use the ``epilog `` variable::
168165
169- import argparse
170- from cmd2 import with_argparser
166+ from cmd2 import Cmd2ArgumentParser, with_argparser
171167
172- argparser = argparse.ArgumentParser (description='create an html tag',
173- epilog='This command cannot generate tags with no content, like <br/>.')
168+ argparser = Cmd2ArgumentParser (description='create an html tag',
169+ epilog='This command cannot generate tags with no content, like <br/>.')
174170 argparser.add_argument('tag', help='tag')
175171 argparser.add_argument('content', nargs='+', help='content to surround with tag')
176172 @with_argparser(argparser)
@@ -265,10 +261,9 @@ strings, then decorate the command method with the
265261
266262Here's what it looks like::
267263
268- import argparse
269- from cmd2 import with_argparser
264+ from cmd2 import Cmd2ArgumentParser, with_argparser
270265
271- dir_parser = argparse.ArgumentParser ()
266+ dir_parser = Cmd2ArgumentParser ()
272267 dir_parser.add_argument('-l', '--long', action='store_true', help="display in long format with one item per line")
273268
274269 @with_argparser(dir_parser, with_unknown_args=True)
0 commit comments