'Display/set/clear/toggle value of eflags register
Usage:
MYNAME
MYNAME [set|clear|toggle] flagname'

def eflags(self, *arg):

    FLAGS = ['CF', 'PF', 'AF', 'ZF', 'SF', 'TF', 'IF', 'DF', 'OF']
    FLAGS_TEXT = ['Carry', 'Parity', 'Adjust', 'Zero', 'Sign', 'Trap', 'Interrupt', 'Direction', 'Overflow']
    (option, flagname) = normalize_argv(arg, 2)
    if (not self._is_running()):
        return
    elif (option and (not flagname)):
        self._missing_argument()
    elif (option is None):
        flags = peda.get_eflags()
        text = ''
        for (i, f) in enumerate(FLAGS):
            if flags[f]:
                text += ('%s    ' % red(FLAGS_TEXT[i].upper(), 'bold'))
            else:
                text += ('%s    ' % green(FLAGS_TEXT[i].lower()))
        eflags = peda.getreg('eflags')
        msg(('%s:    0x%x    (%s)' % (green('EFLAGS'), eflags, text.strip())))
    elif (option == 'set'):
        peda.set_eflags(flagname, True)
    elif (option == 'clear'):
        peda.set_eflags(flagname, False)
    elif (option == 'toggle'):
        peda.set_eflags(flagname, None)
    return
