Output a list of all available CLI commands
772950
protected function outputCommandListHelp()
    {
        $routes = $this->route->getList();

        ksort($routes);

        $rows = array(
            array(
                $this->text('Command'),
                $this->text('Alias'),
                $this->text('Description')
            )
        );

        foreach ($routes as $command => $info) {
            $rows[] = array(
                $command,
                empty($info['alias']) ? '' : $info['alias'],
                empty($info['description']) ? '' : $info['description']
            );
        }

        $this->table($rows);
        $this->output();
    }
1323310
def list_commands(self, ctx):
        """"""
        commands = super(PinaxGroup, self).list_commands(ctx)
        return [cmd for cmd in order_manually(commands)]
988672
def get_all_commands(self) -> List[str]:
        """"""
        return [name[len(COMMAND_FUNC_PREFIX):] for name in self.get_names()
                if name.startswith(COMMAND_FUNC_PREFIX) and callable(getattr(self, name))]
994642
def show_help(self):
        
        output = [
            'Usage %s subcommand [options] [args]' % self.prog_name,
            '',
            'Available commands:',
            '',
        ]
        for cmd in self.get_commands():
            output.append('  %s' % cmd)
        output += ['', '']
        self.stdout.write(u'\n'.join(output))
1215694
def _get_cmd(command, arguments):
    """"""
    if arguments is None:
        arguments = []
    if command.endswith(".py") or command.endswith(".pyw"):
        return [sys.executable, command] + list(arguments)
    else:
        return [command] + list(arguments)
1308358
def get_cmd_tuple_list(self):
    

    # pattern to find DAGman macros
    pat = re.compile(r'\$\((.+)\)')
    argpat = re.compile(r'\d+')

    # first parse the options and replace macros with values
    options = self.job().get_opts()
    macros = self.get_opts()

    cmd_list = []

    for k in options:
      val = options[k]
      m = pat.match(val)
      if m:
        key = m.group(1)
        value = macros[key]

        cmd_list.append(("--%s" % k, str(value)))
      else:
        cmd_list.append(("--%s" % k, str(val)))

    # second parse the short options and replace macros with values
    options = self.job().get_short_opts()

    for k in options:
      val = options[k]
      m = pat.match(val)
      if m:
        key = m.group(1)
        value = macros[key]

        cmd_list.append(("-%s" % k, str(value)))
      else:
        cmd_list.append(("-%s" % k, str(val)))

    # lastly parse the arguments and replace macros with values
    args = self.job().get_args()
    macros = self.get_args()

    for a in args:
      m = pat.match(a)
      if m:
        arg_index = int(argpat.findall(a)[0])
        try:
          cmd_list.append(("%s" % macros[arg_index], ""))
        except IndexError:
          cmd_list.append("")
      else:
        cmd_list.append(("%s" % a, ""))

    return cmd_list
42372
def find_all_commands(management_dir):
    
    try:
        #Find all commands in the directory that are not __init__.py and end in .py.  Then, remove the trailing .py
        return [f[:-3] for f in os.listdir(management_dir) if f.endswith('.py') and not f.startswith("__")]
    except OSError:
        #If nothing is found, return empty
        return []
364462
def cmd_list(options):
    
    (i_info, param_str) = gather_data(options)
    if i_info:
        awsc.get_all_aminames(i_info)
        param_str = "Instance List - " + param_str + "\n"
        list_instances(i_info, param_str)
    else:
        print("No instances found with parameters: {}".format(param_str))
525622
def get_commands(self, view=None):
    
    return self._get("commands", ApiCommand, True,
        params = view and dict(view=view) or None)
337259
def commands(config, names):
    """"""
    commands = {cmd: Command(**dict((minus_to_underscore(k), v)
                                    for k, v in config.items(cmd)))
                for cmd in config.sections()
                if cmd != 'packages'}
    try:
        return tuple(commands[x] for x in names)
    except KeyError as e:
        raise RuntimeError(
            'Section [commands] in the config file does not contain the '
            'key {.args[0]!r} you requested to execute.'.format(e))
851698
def get_commands(self):
		
		shutit_global.shutit_global_object.yield_to_draw()
		s = ''
		for c in self.build['shutit_command_history']:
			if isinstance(c, str):
				#Ignore commands with leading spaces
				if c and c[0] != ' ':
					s += c + '\n'
		return s
843081
def list(self):
        
        queue = self._get_queue()
        if queue is None:
            raise QueueDoesntExist

        output = self.check_output('%s' %
                                   shell_escape(queue / 'commands/list'))

        job_id, info = None, None
        for line in output.splitlines():
            line = line.decode('utf-8')
            if line.startswith('    '):
                key, value = line[4:].split(': ', 1)
                info[key] = value
            else:
                if job_id is not None:
                    yield job_id, info
                job_id = line
                info = {}
        if job_id is not None:
            yield job_id, info
152899
def print_all_commands(self, *, no_pager=False):
        
        formatter = self.parent_parser._get_formatter()
        command_names = sorted(self.parent_parser.subparsers.choices.keys())
        max_name_len = max([len(name) for name in command_names]) + 1
        commands = ""
        for name in command_names:
            command = self.parent_parser.subparsers.choices[name]
            extra_padding = max_name_len - len(name)
            command_line = '%s%s%s' % (
                name, ' ' * extra_padding, command.description)
            while len(command_line) > formatter._width:
                lines = textwrap.wrap(command_line, formatter._width)
                commands += "%s\n" % lines[0]
                if len(lines) > 1:
                    lines[1] = (' ' * max_name_len) + lines[1]
                    command_line = ' '.join(lines[1:])
                else:
                    command_line = None
            if command_line:
                commands += "%s\n" % command_line
        if no_pager:
            print(commands[:-1])
        else:
            print_with_pager(commands[:-1])
1137491
def commands(self):
        
        if self._commands is None:
            self._commands = CommandList(self)
        return self._commands
321211
def commands(self, event):
        
        commands = sorted(self.commands_dict().keys())
        return "Available commands: %s" % " ".join(commands)
1316753
def list_commands(self, ctx):
        """"""
        rv = defaults.list_commands(ctx)
        if self._commands_dir:
            for filename in os.listdir(self._commands_dir):
                if _is_command_file(filename) and filename[:-3] not in rv:
                    rv.append(filename[:-3])
            rv.sort()
        return rv
1140183
def list_all_commands(self):
        
        commands = [name for name, _ in inspect.getmembers(self, predicate=inspect.isroutine) if not name.startswith('_')]
        return commands