Label a method as a command with name.
971460
def command(name, mode):
    
    def decorator(fn):
        commands[name] = fn.__name__
        _Client._addMethod(fn.__name__, name, mode)
        return fn
    return decorator
972726
def cmdLine(useBasename=False):
    """"""
    qargv = []
    cmdwords = list(sys.argv)
    if useBasename:
        cmdwords[0] = os.path.basename(cmdwords[0])
    for s in cmdwords:
        # any white space or special characters in word so we need quoting?
        if re.search(r'\s|\*|\?', s):
            if "'" in s:
                qargv.append('"%s"' % re.sub('"', "'", s))
            else:
                qargv.append("'%s'" % re.sub("'", '"', s))
        else:
            qargv.append(s)
    cmd = ' '.join(qargv)
    return cmd
1208581
def label_for_lm(self, **kwargs):
        ""
        self.__class__ = LMTextList
        kwargs['label_cls'] = LMLabelList
        return self.label_const(0, **kwargs)
413093
def add_command(self, cmd_name, *args):
        """"""
        self.__commands.append(Command(cmd_name, args))
339054
public function command($command, $method) {

        self::$commands[] = $command;
        self::$callbacks[$command] = $method;
    }
752453
def def_cmd(name=None, short=None, fn=None, usage=None, help=None):
    
    command = Command(name=name, short=short, fn=fn, usage=usage, help=help)
    Command.register(command)
22283
def command(name=None):
    
    def decorator(f):
        _commands.append((name, f))
        return f
    return decorator
1330654
def get_method_name(method):
    

    name = get_object_name(method)
    if name.startswith("__") and not name.endswith("__"):
        name = "_{0}{1}".format(get_object_name(method.im_class), name)
    return name
259574
def make_column_label(command_name, description, default):
    ''''''
    for (pattern, label) in description_map:
        if fnmatch.fnmatch(description, pattern):
            return label
    return default
429101
def as_string(self):
        """"""
        if type(self.instruction) is str:
            return self.instruction

        if self.action == "FROM" and not isinstance(self.command, six.string_types):
            extra = "" if self.extra is NotSpecified else " {0}".format(self.extra)
            return "{0} {1}{2}".format(self.action, self.command.from_name, extra)
        else:
            return "{0} {1}".format(self.action, self.command)
528680
def executable(name)
      define_method(name) do |*command|
        Executable.execute_command(name, Array(command).flatten, false)
      end

      define_method(name.to_s + '!') do |*command|
        Executable.execute_command(name, Array(command).flatten, true)
      end
    end
201357
function( name, method ) {
			var m = this.settings.messages[name];
			return m && (m.constructor === String ? m : m[method]);
		}
460156
def get_column_labels(command_name):
    ''''''
    cmd = cmd_reverse_lookup(command_name)
    if cmd == 0:
        return {}
    labels = {}
    enum = mavutil.mavlink.enums['MAV_CMD'][cmd]
    for col in enum.param.keys():
        labels[col] = make_column_label(command_name, enum.param[col], "P%u" % col)
    return labels
1002074
def command(self, name=None):
        
        def decorator(f):
            self.add_command(f, name)
            return f
        return decorator
688511
def add_command(self, handler, name=None):
        
        if name is None:
            name = docstring_to_subcommand(handler.__doc__)

        # TODO: Prevent overwriting 'help'?
        self._commands[name] = handler
501255
private static String createSig(Method m) {
        return m.getName() + ':' + MethodDesc.forMethod(m).getDescriptor();
    }
1030062
def call(self, name, args=None):  # type: (str, Optional[str]) -> int
        
        if args is None:
            args = ""

        args = StringArgs(args)
        command = self.application.get_command(name)

        return command.run(args, self.io)