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

Method do_unload

examples/command_sets.py:136–144  ·  view source on GitHub ↗

Unload a CommandSet at runtime.

(self, ns: argparse.Namespace)

Source from the content-addressed store, hash-verified

134 @with_argparser(load_parser)
135 @with_category(COMMANDSET_LOAD_UNLOAD)
136 def do_unload(self, ns: argparse.Namespace) -> None:
137 """Unload a CommandSet at runtime."""
138 if ns.cmds == "fruits":
139 self.unregister_command_set(self._fruits)
140 self.poutput("Fruits unloaded")
141
142 if ns.cmds == "vegetables":
143 self.unregister_command_set(self._vegetables)
144 self.poutput("Vegetables unloaded")
145
146 cut_parser = cmd2.Cmd2ArgumentParser()
147 cut_subparsers = cut_parser.add_subparsers(title="item", help="item to cut")

Callers

nothing calls this directly

Calls 2

poutputMethod · 0.80

Tested by

no test coverage detected