MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / do_cut

Method do_cut

tests/test_commandset.py:728–737  ·  view source on GitHub ↗

Cut something

(self, ns: argparse.Namespace)

Source from the content-addressed store, hash-verified

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"])

Callers

nothing calls this directly

Calls 2

poutputMethod · 0.80
do_helpMethod · 0.80

Tested by

no test coverage detected