Add a Cmd subclass to this cli.
483909
def addCmdClass(self, ctor, **opts):
        '''
        
        '''
        item = ctor(self, **opts)
        name = item.getCmdName()
        self.cmds[name] = item
1342717
def cmd_wrapper(cmd_name, **kwds):
    """"""
    cmd = si.Commands(cmd_name)
    if not cmd:
        raise Exception(cmd_name + " doesnt found!")
    for arg in cmd.Arguments:
        value = kwds.get(arg.Name)
        if value:
            arg.Value = value
    return cmd.Execute()
1186148
public void addCommandClass(ZWaveCommandClass commandClass)
	{
		ZWaveCommandClass.CommandClass key = commandClass.getCommandClass();
		
		if (!supportedCommandClasses.containsKey(key)) {
			supportedCommandClasses.put(key, commandClass);
			
			if (commandClass instanceof ZWaveEventListener)
				this.controller.addEventListener((ZWaveEventListener)commandClass);
			
			this.lastUpdated = Calendar.getInstance().getTime();
		}
	}
383379
def _run_command(self, cmdline):
        """"""
        try:
            if self.verbose:
                print(cmdline)
            subprocess.check_call(cmdline, shell=True)
        except subprocess.CalledProcessError:
            print('when running: ', cmdline)
            raise
820788
def subcommand(self, name, help):
    
    if self._subcommands is None:
      self._subcommands = self.add_subparsers(help='commands')
    return self._subcommands.add_parser(name, description=help, help=help)
411915
def runCmd(cls, cmd):
        
        cit.echo(cmd, "command")
        result = os.system(cmd)
        cls.checkResult(result)
635528
def setCmd(self, cmd):
        """"""
        cmd = cmd.upper()
        if cmd not in VALID_COMMANDS:
            raise FrameError("The cmd '%s' is not valid! It must be one of '%s' (STOMP v%s)." % (
                cmd, VALID_COMMANDS, STOMP_VERSION)
            )
        else:
            self._cmd = cmd
883716
def set_default_command(self, command):
        """"""
        cmd_name = command.name
        self.add_command(command)
        self.default_cmd_name = cmd_name
239066
def add_cmd_handler(self, cmd, func):
        """"""
        len_args = len(inspect.getargspec(func)[0])

        def add_meta(f):
            def decorator(*args, **kwargs):
                f(*args, **kwargs)
            decorator.bytes_needed = len_args - 1  # exclude self
            decorator.__name__ = f.__name__
            return decorator
        func = add_meta(func)
        self._command_handlers[cmd] = func
986081
def commands(cls):
        """"""
        cmds = [cmd[4:] for cmd in dir(cls) if cmd.startswith('cmd_')]
        return cmds
1002159
public void addChild(Command cmd)
	{
		if (cmd != null)
		{
			cmd.setContext(this);
			commands.add(cmd);
		}
	}
690620
def register(self, command):
        
        command = command()
        if command.name in self.commands:
            raise ConsoleError(
                "Command %s already registered!" % command.name
            )

        command.create_parser(self.subparsers)
        self.commands[command.name] = command
1013601
def activate():
    
    # This is derived from the clone
    cli = CommandLineInterface()
    cli.ensure_config()
    cli.write_dockerfile()
    cli.build()
    cli.run()
1095274
def _run_cmd(cmd):
    """"""
    if not os.path.exists(cmd[0]):
        cmd[0] = shutil.which(cmd[0])
        assert cmd[0] is not None

    shebang_parts = parseshebang.parse(cmd[0])

    proc = subprocess.Popen(shebang_parts + cmd,
                            stdout=subprocess.PIPE,
                            stderr=subprocess.PIPE)
    stdout, stderr = proc.communicate()
    return {
        "stdout": stdout,
        "stderr": stderr,
        "code": proc.returncode
    }
343119
def add(**kwargs):
  '''  '''

  output, err = cli_syncthing_adapter.add(**kwargs)
  click.echo("%s" % output, err=err)
81634
def call_command(self, cmdname, **kw):
        """"""
        for dirname in INSTALL_DIRECTORY_ATTRS:
            kw.setdefault(dirname, self.bdist_dir)
        kw.setdefault('skip_build', self.skip_build)
        kw.setdefault('dry_run', self.dry_run)
        cmd = self.reinitialize_command(cmdname, **kw)
        self.run_command(cmdname)
        return cmd
323569
def cli(self, *args, **kwargs):
        """"""
        kwargs['api'] = self.api
        return cli(*args, **kwargs)