help [command] - displays available commands, or help message for given command
199735
def help(self, msg):
        
        commands = {}
        for handler in self.irc.handlers:
            if isinstance(handler, CommandHandler):
                for command in handler.triggers:
                    method = getattr(handler, command)
                    if hasattr(method, '__doc__') and method.__doc__:
                        commands[command] = method.__doc__.strip()
                    else:
                        commands[command] = 'No help available for command: %s' % command

        if len(msg.args) == 2:
            if msg.args[1] not in commands:
                message = 'Unknown command: %s' % msg.args[1]
            else:
                message = commands[msg.args[1]]
        else:
            message = 'Available commands: %s' % ', '.join(commands.keys())

        if msg.event == EVT_PUBLIC:
            self.irc.msg(msg.dst, message)
        elif msg.event == EVT_PRIVATE:
            self.irc.msg(msg.src, message)
        elif msg.event == EVT_NOTICE:
            self.irc.notice(msg.src, message)
72659
def help(self, *args):
        
        if args:
            self.messages.error(
                            self.messages.command_does_not_accept_arguments)
        else:
            print(self.helpfull)
1259990
def _show_help(self, txt,
                mode_to_set=MAIN_HELP_MODE,
                caption=' Help ',
                prompt=' Press any key to hide ',
                too_small_msg='Window too small to show message',
                is_message=False):
        
        self.helpWinContainer = None
        self.helpWin = None
        self.operation_mode = mode_to_set
        txt_col = curses.color_pair(5)
        box_col = curses.color_pair(3)
        caption_col = curses.color_pair(4)
        lines = txt.split('\n')
        st_lines = [item.replace('\r','') for item in lines]
        lines = [item.strip() for item in st_lines]
        inner_height = len(lines) + 2
        inner_width = self._get_message_width_from_list(lines) + 4
        outer_height = inner_height + 2
        outer_width = inner_width + 2
        if self.window_mode == CONFIG_MODE and \
                self.operation_mode > CONFIG_HELP_MODE:
            use_empty_win = True
            height_to_use = outer_height
            width_to_use = outer_width
        else:
            use_empty_win = False
            height_to_use = inner_height
            width_to_use = inner_width
        if self.maxY - 2 < outer_height or self.maxX < outer_width:
            txt = too_small_msg
            inner_height = 3
            inner_width = len(txt) + 4
            if use_empty_win:
                height_to_use = inner_height +2
                width_to_use = inner_width + 2
            else:
                height_to_use = inner_height
                width_to_use = inner_width
            if self.maxX < width_to_use:
                if logger.isEnabledFor(logging.DEBUG):
                    logger.debug('  ***  Window too small even to show help warning  ***')
                self.operation_mode = self.window_mode = NORMAL_MODE
                return
            lines = [ txt , ]
        if use_empty_win:
            self.helpWinContainer = curses.newwin(height_to_use,width_to_use,int((self.maxY-height_to_use)/2),int((self.maxX-width_to_use)/2))
            self.helpWinContainer.bkgdset(' ', box_col)
            self.helpWinContainer.erase()
        self.helpWin = curses.newwin(inner_height,inner_width,int((self.maxY-inner_height)/2),int((self.maxX-inner_width)/2))
        self.helpWin.bkgdset(' ', box_col)
        self.helpWin.erase()
        self.helpWin.box()
        if is_message:
            start_with = txt_col
            follow = caption_col
        else:
            start_with = caption_col
            follow = txt_col
        if caption.strip():
            self.helpWin.addstr(0, int((inner_width-len(caption))/2), caption, caption_col)
        splited = []
        for i, n in enumerate(lines):
            a_line = self._replace_starting_undesscore(n)
            if a_line.startswith('%'):
                self.helpWin.move(i + 1, 0)
                try:
                    self.helpWin.addstr('├', curses.color_pair(3))
                    self.helpWin.addstr('─' * (inner_width - 2), curses.color_pair(3))
                    self.helpWin.addstr('┤', curses.color_pair(3))
                except:
                    self.helpWin.addstr('├'.encode('utf-8'), curses.color_pair(3))
                    self.helpWin.addstr('─'.encode('utf-8') * (inner_width - 2), curses.color_pair(3))
                    self.helpWin.addstr('┤'.encode('utf-8'), curses.color_pair(3))
                self.helpWin.addstr(i + 1, inner_width-len(a_line[1:]) - 1, a_line[1:].replace('_', ' '), caption_col)
                #self.helpWin.addstr(i + 1, int((inner_width-len(a_line[1:]))/2), a_line[1:].replace('_', ' '), caption_col)
            else:
                splited = a_line.split('|')
                self.helpWin.move(i + 1, 2)
                for part, part_string in enumerate(splited):
                    if part_string.strip():
                        if part == 0 or part % 2 == 0:
                            self.helpWin.addstr(splited[part], start_with)
                        else:
                            self.helpWin.addstr(splited[part], follow)
        if prompt.strip():
            self.helpWin.addstr(inner_height - 1, int(inner_width-len(prompt)-1), prompt)
        if use_empty_win:
            self.helpWinContainer.refresh()
        self.helpWin.refresh()
1094675
public function listCommand(): void
    {
        $list = [
            'The is a list line 0',
            'The is a list line 1',
            'The is a list line 2',
            'The is a list line 3',
        ];

        Show::aList($list, 'a List show(No key)');

        $commands = [
            'version' => 'Show application version information',
            'help'    => 'Show application help information',
            'list'    => 'List all group and independent commands',
            'a only value message text'
        ];

        Show::aList($commands, 'a List show(Has key)');
    }
805077
def complete_command_help(self, tokens: List[str], text: str, line: str, begidx: int, endidx: int) -> List[str]:
        """"""
        for idx, token in enumerate(tokens):
            if idx >= self._token_start_index:
                if self._positional_completers:
                    # For now argparse only allows 1 sub-command group per level
                    # so this will only loop once.
                    for completers in self._positional_completers.values():
                        if token in completers:
                            return completers[token].complete_command_help(tokens, text, line, begidx, endidx)
                        else:
                            return self._cmd2_app.basic_complete(text, line, begidx, endidx, completers.keys())
        return []
828673
def command_name(app_name, command, help_text):
    
    command = clr.stringc(command, "cyan")
    help = clr.stringc("--help", "green")

    return "{0} {1} {2}\n{3}\n\n".format(app_name, command,
                                         help, help_text)
1200549
def do_help(self, args: argparse.Namespace) -> None:
        """"""
        if not args.command or args.verbose:
            self._help_menu(args.verbose)

        else:
            # Getting help for a specific command
            func = self.cmd_func(args.command)
            help_func = getattr(self, HELP_FUNC_PREFIX + args.command, None)

            # If the command function uses argparse, then use argparse's help
            if func and hasattr(func, 'argparser'):
                completer = AutoCompleter(getattr(func, 'argparser'), self)
                tokens = [args.command] + args.subcommand
                self.poutput(completer.format_help(tokens))

            # If there is no help information then print an error
            elif help_func is None and (func is None or not func.__doc__):
                err_msg = self.help_error.format(args.command)
                self.decolorized_write(sys.stderr, "{}\n".format(err_msg))

            # Otherwise delegate to cmd base class do_help()
            else:
                super().do_help(args.command)
327450
private void showHelp(final Terminal terminal) {
		showMessage(terminal, "/message.txt");
		commands.stream().filter(c -> !c.isHidden()).forEach(c -> c.showHelp(terminal));
	}
742382
def help(self, command=None):
    '''

    '''
    from spython.utils import check_install
    check_install()

    cmd = ['singularity','--help']
    if command != None:
        cmd.append(command)
    help = self._run_command(cmd)
    return help
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)
360552
def print_help(self):
        

        print('\n  %s %s' % (self._title or self._name, self._version or ''))

        if self._usage:
            print('\n  %s' % self._usage)
        else:
            cmd = self._name
            if hasattr(self, '_parent') and isinstance(self._parent, Command):
                cmd = '%s %s' % (self._parent._name, cmd)

            if self._command_list:
                usage = 'Usage: %s <command> [option]' % cmd
            else:
                usage = 'Usage: %s [option]' % cmd

            pos = ' '.join(['<%s>' % name for name in self._positional_list])
            print('\n  %s %s' % (usage, pos))

        arglen = max(len(o.name) for o in self._option_list)
        arglen += 2

        self.print_title('\n  Options:\n')
        for o in self._option_list:
            print('    %s %s' % (_pad(o.name, arglen), o.description or ''))
        print('')

        if self._command_list:
            self.print_title('  Commands:\n')
            for cmd in self._command_list:
                if isinstance(cmd, Command):
                    name = _pad(cmd._name, arglen)
                    desc = cmd._description or ''
                    print('    %s %s' % (_pad(name, arglen), desc))

            print('')

        if self._help_footer:
            print(self._help_footer)
            print('')

        return self
205936
def do_help(self, line):
        
        command, = self._split_args(line, 0, 1)
        if command is None:
            return self._print_help()
        cmd.Cmd.do_help(self, line)
385878
def do_help(self, arg):
        """"""
        if not arg or arg not in self.argparse_names():
            cmd.Cmd.do_help(self, arg)
        else:
            try:
                self.argparser.parse_args([arg, '--help'])
            except Exception:
                pass
1188439
def help(command): # this comes first to make it easy to spot
		'''  '''
		for i, v in ByPy.__dict__.items():
			if callable(v) and v.__doc__ and v.__name__ == command :
				help = v.__doc__.strip()
				pos = help.find(const.HelpMarker)
				if pos != -1:
					pr("Usage: " + help[pos + len(const.HelpMarker):].strip())
1230414
def help_message():
    """"""
    parser = autopep8.create_parser()
    string_io = io.StringIO()
    parser.print_help(string_io)
    # Undo home directory expansion.
    return string_io.getvalue().replace(os.path.expanduser('~'), '~')
411804
def cmd_help(self, *args):
        
        if len(args) > 0:
            cmdname = args[0].lower()
            try:
                method = getattr(self, "cmd_" + cmdname)
                doc = method.__doc__
                if doc is None:
                    self.log("Sorry, no documentation found for '%s'" % (
                        cmdname))
                else:
                    self.log("%s: %s" % (cmdname, doc))
            except AttributeError:
                self.log("No such command '%s'; type help for general help." % (
                    cmdname))
        else:
            res = []
            for attrname in dir(self):
                if attrname.startswith('cmd_'):
                    method = getattr(self, attrname)
                    doc = method.__doc__
                    cmdname = attrname[4:]
                    if doc is None:
                        doc = "no documentation"
                    res.append("%s: %s" % (cmdname, doc))
            self.log('\n'.join(res))
443058
def ListCommands(self):
    """"""
    print 'Available commands:'
    commands = dict(self.commands)
    for plugin in self.plugins:
      commands.update(plugin.commands)
    for com in sorted(commands):
      if not com.startswith('_'):
        self.PrintHelpTextLine(com, commands[com])