add subcommand of calculate command.
(self, args: argparse.Namespace)
| 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: |
no test coverage detected