def execute(self, class_, command, **kw): if command is None: return False registry.commands()[command] = class_ class_.name = command return True
def execute(self, class_, alias, **kwargs): if not getattr(class_, 'aliases', None): class_.aliases = [] if alias: class_.aliases.append(alias) registry.commands()[alias] = class_ return False
def content(self): # circular import from opennode.oms.endpoint.ssh.cmd import registry return dict((name, Command(name, self, cmd)) for name, cmd in registry.commands().items() if name)
def test_help(self): self._cmd('help') with assert_mock(self.terminal) as t: for cmd in commands().keys(): assert cmd in current_call(t).arg