Stir something
(self, ns: argparse.Namespace)
| 419 | |
| 420 | @cmd2.with_argparser(stir_parser, ns_provider=namespace_provider) |
| 421 | def do_stir(self, ns: argparse.Namespace) -> None: |
| 422 | """Stir something""" |
| 423 | if not ns.cut_called: |
| 424 | self._cmd.poutput("Need to cut before stirring") |
| 425 | return |
| 426 | |
| 427 | handler = ns.cmd2_subcmd_handler |
| 428 | if handler is not None: |
| 429 | # Call whatever subcommand function was selected |
| 430 | handler(ns) |
| 431 | else: |
| 432 | # No subcommand was provided, so call help |
| 433 | self._cmd.pwarning("This command does nothing without sub-parsers registered") |
| 434 | self._cmd.do_help("stir") |
| 435 | |
| 436 | stir_pasta_parser = cmd2.Cmd2ArgumentParser() |
| 437 | stir_pasta_parser.add_argument("--option", "-o") |