'Set various PEDA options and other settings
Usage:
MYNAME option name value
MYNAME arg string
MYNAME env name value
support input non-printable chars, e.g MYNAME env EGG "\x90"*1000'

def set(self, *arg):

    def _set_option(name, value):
        if (name in config.Option.options):
            config.Option.set(name, value)
            msg(('%s    =    %s' % (name, repr(value))))
        else:
            msg(('Unknown    option:    %s' % name))
        return
    def _set_arg(*arg):
        cmd = 'set    args'
        for a in arg:
            try:
                s = eval(('%s' % a))
                if isinstance(s, (six.integer_types + six.string_types)):
                    a = s
            except:
                pass
            cmd += ("    '%s'" % a)
        peda.execute(cmd)
        return
    def _set_env(name, value):
        env = peda.execute_redirect('show    env')
        cmd = ('set    env    %s    ' % name)
        try:
            value = eval(('%s' % value))
        except:
            pass
        cmd += ('%s' % value)
        peda.execute(cmd)
        return
    (opt, name, value) = normalize_argv(arg, 3)
    if (opt is None):
        self._missing_argument()
    if opt.startswith('opt'):
        if (value is None):
            self._missing_argument()
        _set_option(name, value)
    elif opt.startswith('arg'):
        _set_arg(*arg[1:])
    elif opt.startswith('env'):
        _set_env(name, value)
    else:
        msg(('Unknown    set    option:    %s' % known_args.opt))
    return
