Intended to be used with dynamically loaded subcommands specifically.
(self, ns: argparse.Namespace)
| 149 | @with_argparser(cut_parser) |
| 150 | @with_category(COMMANDSET_SUBCOMMAND) |
| 151 | def do_cut(self, ns: argparse.Namespace) -> None: |
| 152 | """Intended to be used with dynamically loaded subcommands specifically.""" |
| 153 | handler = ns.cmd2_subcmd_handler |
| 154 | if handler is not None: |
| 155 | handler(ns) |
| 156 | else: |
| 157 | # No subcommand was provided, so call help |
| 158 | self.poutput("This command does nothing without sub-parsers registered") |
| 159 | self.do_help("cut") |
| 160 | |
| 161 | |
| 162 | if __name__ == "__main__": |