'Get the help text, for internal use by help command and other aliases'

def _get_helptext(self, *arg):

    (cmd,) = normalize_argv(arg, 1)
    helptext = ''
    if (cmd is None):
        helptext = ((red('PEDA', 'bold') + blue('    -    Python    Exploit    Development    Assistance    for    GDB', 'bold')) + '\n')
        helptext += ('For    latest    update,    check    peda    project    page:    %s\n' % green('https://github.com/longld/peda/'))
        helptext += 'List    of    "peda"    subcommands,    type    the    subcommand    to    invoke    it:\n'
        i = 0
        for cmd in self.commands:
            if cmd.startswith('_'):
                continue
            func = getattr(self, cmd)
            helptext += ('%s    --    %s\n' % (cmd, green(trim(func.__doc__.strip('\n').splitlines()[0]))))
        helptext += '\nType    "help"    followed    by    subcommand    for    full    documentation.'
    elif (cmd in self.commands):
        func = getattr(self, cmd)
        lines = trim(func.__doc__).splitlines()
        helptext += (green(lines[0]) + '\n')
        for line in lines[1:]:
            if ('Usage:' in line):
                helptext += (blue(line) + '\n')
            else:
                helptext += (line + '\n')
    else:
        for c in self.commands:
            if ((not c.startswith('_')) and (cmd in c)):
                func = getattr(self, c)
                helptext += ('%s    --    %s\n' % (c, green(trim(func.__doc__.strip('\n').splitlines()[0]))))
    return helptext
