MCPcopy
hub / github.com/HKUDS/OpenHarness / register

Method register

src/openharness/commands/registry.py:136–142  ·  view source on GitHub ↗

Register a command, plus any aliases pointing at the same handler.

(self, command: SlashCommand)

Source from the content-addressed store, hash-verified

134 self._canonical_names: list[str] = []
135
136 def register(self, command: SlashCommand) -> None:
137 """Register a command, plus any aliases pointing at the same handler."""
138 if command.name not in self._commands:
139 self._canonical_names.append(command.name)
140 self._commands[command.name] = command
141 for alias in command.aliases:
142 self._commands[alias] = command
143
144 def lookup(self, raw_input: str) -> tuple[SlashCommand, str] | None:
145 """Parse a slash command and return its handler plus raw args."""

Calls

no outgoing calls

Tested by 1

test_commands_registryFunction · 0.76