@@ -52,7 +52,7 @@ def with_category(
5252 Example:
5353 ```py
5454 class MyApp(cmd2.Cmd):
55- @cmd2.with_category(' Text Functions' )
55+ @cmd2.with_category(" Text Functions" )
5656 def do_echo(self, args: cmd2.Statement) -> None:
5757 self.poutput(args)
5858 ```
@@ -159,12 +159,12 @@ class MyApp(cmd2.Cmd):
159159 # Basic usage: receives a list of words with quotes stripped
160160 @cmd2.with_argument_list
161161 def do_echo(self, arglist: list[str]) -> None:
162- self.poutput(' ' .join(arglist))
162+ self.poutput(" " .join(arglist))
163163
164164 # Factory usage: preserves quotes in the argument list
165165 @cmd2.with_argument_list(preserve_quotes=True)
166166 def do_print_raw(self, arglist: list[str]) -> None:
167- self.poutput(' ' .join(arglist))
167+ self.poutput(" " .join(arglist))
168168 ```
169169
170170 """
@@ -268,32 +268,34 @@ def with_argparser(
268268 Example:
269269 ```py
270270 parser = cmd2.Cmd2ArgumentParser()
271- parser.add_argument('-p', '--piglatin', action='store_true', help='atinLay')
272- parser.add_argument('-s', '--shout', action='store_true', help='N00B EMULATION MODE')
273- parser.add_argument('-r', '--repeat', type=int, help='output [n] times')
274- parser.add_argument('words', nargs='+', help='words to print')
271+ parser.add_argument("-p", "--piglatin", action="store_true", help="atinLay")
272+ parser.add_argument("-s", "--shout", action="store_true", help="N00B EMULATION MODE")
273+ parser.add_argument("-r", "--repeat", type=int, help="output [n] times")
274+ parser.add_argument("words", nargs="+", help="words to print")
275+
275276
276277 class MyApp(cmd2.Cmd):
277278 @cmd2.with_argparser(parser, preserve_quotes=True)
278279 def do_argprint(self, args: argparse.Namespace) -> None:
279280 "Print the options and argument list this options command was called with."
280- self.poutput(f' args: {args!r}' )
281+ self.poutput(f" args: {args!r}" )
281282 ```
282283
283284 Example with unknown args:
284285
285286 ```py
286287 parser = cmd2.Cmd2ArgumentParser()
287- parser.add_argument('-p', '--piglatin', action='store_true', help='atinLay')
288- parser.add_argument('-s', '--shout', action='store_true', help='N00B EMULATION MODE')
289- parser.add_argument('-r', '--repeat', type=int, help='output [n] times')
288+ parser.add_argument("-p", "--piglatin", action="store_true", help="atinLay")
289+ parser.add_argument("-s", "--shout", action="store_true", help="N00B EMULATION MODE")
290+ parser.add_argument("-r", "--repeat", type=int, help="output [n] times")
291+
290292
291293 class MyApp(cmd2.Cmd):
292294 @cmd2.with_argparser(parser, with_unknown_args=True)
293295 def do_argprint(self, args: argparse.Namespace, unknown_args: list[str]):
294296 "Print the options and argument list this options command was called with."
295- self.poutput(f' args: {args!r}' )
296- self.poutput(f' unknown_args: {unknown_args}' )
297+ self.poutput(f" args: {args!r}" )
298+ self.poutput(f" unknown_args: {unknown_args}" )
297299 ```
298300
299301 """
@@ -447,14 +449,15 @@ def as_subcommand_to(
447449 base_parser.add_subparsers(title="subcommands", metavar="SUBCOMMAND", required=True)
448450 sub_parser = cmd2.Cmd2ArgumentParser()
449451
452+
450453 class MyApp(cmd2.Cmd):
451454 @cmd2.with_argparser(base_parser)
452455 def do_base(self, args: argparse.Namespace) -> None:
453456 args.cmd2_subcmd_handler(args)
454457
455- @cmd2.as_subcommand_to(' base', ' sub' , sub_parser, help="the subcommand")
458+ @cmd2.as_subcommand_to(" base", " sub" , sub_parser, help="the subcommand")
456459 def sub_handler(self, args: argparse.Namespace) -> None:
457- self.poutput(' Subcommand executed' )
460+ self.poutput(" Subcommand executed" )
458461 ```
459462
460463 """
0 commit comments