'Show various PEDA options and other settings
Usage:
MYNAME option [optname]
MYNAME (show all options)
MYNAME args
MYNAME env [envname]'

def show(self, *arg):

    def _show_option(name=None):
        if (name is None):
            name = ''
        filename = peda.getfile()
        if filename:
            filename = os.path.basename(filename)
        else:
            filename = None
        for (k, v) in sorted(config.Option.show(name).items()):
            if (filename and isinstance(v, str) and ('#FILENAME#' in v)):
                v = v.replace('#FILENAME#', filename)
            msg(('%s    =    %s' % (k, repr(v))))
        return
    def _show_arg():
        arg = peda.execute_redirect('show    args')
        arg = arg.split('started    is    ')[1][1:(-3)]
        arg = peda.string_to_argv(arg)
        if (not arg):
            msg('No    argument')
        for (i, a) in enumerate(arg):
            text = ('arg[%d]:    %s' % ((i + 1), (a if is_printable(a) else to_hexstr(a))))
            msg(text)
        return
    def _show_env(name=None):
        if (name is None):
            name = ''
        env = peda.execute_redirect('show    env')
        for line in env.splitlines():
            (k, v) = line.split('=', 1)
            if k.startswith(name):
                msg(('%s    =    %s' % (k, (v if is_printable(v) else to_hexstr(v)))))
        return
    (opt, name) = normalize_argv(arg, 2)
    if ((opt is None) or opt.startswith('opt')):
        _show_option(name)
    elif opt.startswith('arg'):
        _show_arg()
    elif opt.startswith('env'):
        _show_env(name)
    else:
        msg(('Unknown    show    option:    %s' % opt))
    return
