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

Class ApCustomTestApp

tests/test_argparse_utils.py:29–43  ·  view source on GitHub ↗

Test app for cmd2's argparse customization

Source from the content-addressed store, hash-verified

27
28
29class ApCustomTestApp(cmd2.Cmd):
30 """Test app for cmd2's argparse customization"""
31
32 def __init__(self, *args, **kwargs) -> None:
33 super().__init__(*args, **kwargs)
34
35 range_parser = Cmd2ArgumentParser()
36 range_parser.add_argument("--arg0", nargs=1)
37 range_parser.add_argument("--arg1", nargs=2)
38 range_parser.add_argument("--arg2", nargs=(3,))
39 range_parser.add_argument("--arg3", nargs=(2, 3))
40
41 @cmd2.with_argparser(range_parser)
42 def do_range(self, _) -> None:
43 pass
44
45
46@pytest.fixture

Callers 1

cust_appFunction · 0.85

Calls 1

Cmd2ArgumentParserClass · 0.90

Tested by 1

cust_appFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…