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

Class CommandSetWithPathComplete

tests/test_commandset.py:968–979  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

966
967
968class CommandSetWithPathComplete(cmd2.CommandSet):
969 def __init__(self, dummy) -> None:
970 """Dummy variable prevents this from being autoloaded in other tests"""
971 super().__init__()
972
973 parser = cmd2.Cmd2ArgumentParser()
974 parser.add_argument("path", nargs="+", help="paths", completer=cmd2.Cmd.path_complete)
975
976 @cmd2.with_argparser(parser)
977 def do_path(self, app: cmd2.Cmd, args) -> None:
978 """Path Command"""
979 app.poutput(args.path)
980
981
982def test_path_complete(manual_command_sets_app) -> None:

Callers 1

test_path_completeFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_path_completeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…