Cut something
(self, ns: argparse.Namespace)
| 726 | |
| 727 | @cmd2.with_argparser(cut_parser) |
| 728 | def do_cut(self, ns: argparse.Namespace) -> None: |
| 729 | """Cut something""" |
| 730 | handler = ns.cmd2_subcmd_handler |
| 731 | if handler is not None: |
| 732 | # Call whatever subcommand function was selected |
| 733 | handler(ns) |
| 734 | else: |
| 735 | # No subcommand was provided, so call help |
| 736 | self.poutput("This command does nothing without sub-parsers registered") |
| 737 | self.do_help("cut") |
| 738 | |
| 739 | banana_parser = cmd2.Cmd2ArgumentParser() |
| 740 | banana_parser.add_argument("direction", choices=["discs", "lengthwise"]) |