Adds a ICommand command to this command set.
        
        :param command: a command instance to be added
493521
def add_command(self, command):
        
        self._commands.append(command)
        self._build_command_chain(command)
1173728
def add_command(self, command, function, description=None):
        
        super(Program, self).add_command(command, function, description)
        self.service.register(command, function)
1296815
def register(self, command: str, handler: Any):
        

        if not command.startswith("/"):
            command = f"/{command}"

        LOG.info("Registering %s to %s", command, handler)
        self._routes[command].append(handler)
908568
public function add(Command $command)
    {
        if ($command instanceof ContainerAwareInterface) {
            $command->setContainer($this->container);
        }

        if ($command instanceof BasePhpcrCommand) {
            if ($this->showUnsupported || $command->isSupported()) {
                parent::add($command);
            }
        } else {
            parent::add($command);
        }
    }
1002074
def command(self, name=None):
        
        def decorator(f):
            self.add_command(f, name)
            return f
        return decorator
1273190
def add_command_alias(command_name, alias_command, callback) #:nodoc:
      original_command = @commands[:meta][command_name]
      original_command[:syntax] << alias_command[:syntax]

      alias_name = command_name(alias_command[:syntax])

      alias_command[:is_public] = original_command[:is_public]

      add_command_meta(alias_name, original_command, true)
      add_command_spec(alias_command, callback)
    end
645575
def add_command(self, command, function, description=None):
        

        self.registered[command] = {
            'function': function, 'description': description
        }
964428
public void addReleaseCommand (int keyCode, String command)
    {
        KeyRecord krec = getKeyRecord(keyCode);
        krec.releaseCommand = command;
    }
1002159
public void addChild(Command cmd)
	{
		if (cmd != null)
		{
			cmd.setContext(this);
			commands.add(cmd);
		}
	}
315965
def update(self, command=None, **kwargs):
        
        if command is None:
            argparser = self.argparser
        else:
            argparser = self[command]

        for k,v in kwargs.items():
            setattr(argparser, k, v)
135925
def register_command(self, name, command):
        
        if name in self.commands:
            raise RuntimeError('%s is already defined' % name)
        self.commands[name] = command
563766
def command(self, *args, **kwargs):
        
        def decorator(func):
            kwargs.setdefault('parent', self)
            result = command(*args, **kwargs)(func)
            self.add_command(result)
            return result

        return decorator
22493
def enable_command(self, command: str) -> None:
        
        # If the commands is already enabled, then return
        if command not in self.disabled_commands:
            return

        help_func_name = HELP_FUNC_PREFIX + command

        # Restore the command and help functions to their original values
        dc = self.disabled_commands[command]
        setattr(self, self.cmd_func_name(command), dc.command_function)

        if dc.help_function is None:
            delattr(self, help_func_name)
        else:
            setattr(self, help_func_name, dc.help_function)

        # Remove the disabled command entry
        del self.disabled_commands[command]
1227821
public void bindCommand(Control control, Command command) {
		commands.put(control, command);

		if (commandState.get(command) == null) {
			commandState.put(command, new CommandState());
		}
	}
1291969
def set_commands(self, commands, timeout=None):
        
        self.desired_commands = commands

        target_commands = list(self.desired_commands)
        for process in list(self.processes):
            found = False
            for i in range(len(target_commands)):
                if process["command"] == target_commands[i]:
                    target_commands.pop(i)
                    found = True
                    break

            if not found:
                self.stop_process(process, timeout)

        # What is left are the commands to add
        # TODO: we should only do this once memory conditions allow
        for command in target_commands:
            self.spawn(command)
413093
def add_command(self, cmd_name, *args):
        """"""
        self.__commands.append(Command(cmd_name, args))
604883
def _send_command(self, command):
        
        try:
            if isinstance(command, list):
                for cmd in command:
                    output = self.device.send_command(cmd)
                    if "% Invalid" not in output:
                        break
            else:
                output = self.device.send_command(command)
            return self._send_command_postprocess(output)
        except (socket.error, EOFError) as e:
            raise ConnectionClosedException(str(e))