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

Method add

examples/argparse_example.py:127–130  ·  view source on GitHub ↗

add subcommand of calculate command.

(self, args: argparse.Namespace)

Source from the content-addressed store, hash-verified

125 # subcommand functions for the calculate command
126 @cmd2.as_subcommand_to("calculate", "add", add_parser, help=add_description.lower())
127 def add(self, args: argparse.Namespace) -> None:
128 """add subcommand of calculate command."""
129 result = args.num1 + args.num2
130 self.poutput(f"{args.num1} + {args.num2} = {result}")
131
132 @cmd2.as_subcommand_to("calculate", "subtract", subtract_parser, help=subtract_description.lower())
133 def subtract(self, args: argparse.Namespace) -> None:

Callers 7

update_progMethod · 0.80
get_exes_in_pathFunction · 0.80
register_command_setMethod · 0.80
_macro_createMethod · 0.80
get_sub_commandsFunction · 0.80

Calls 1

poutputMethod · 0.80

Tested by

no test coverage detected