def get_argflag(argstr_, default=False, help_='', return_specified=None,
                need_prefix=True, return_was_specified=False, argv=None,
                debug=None,
                **kwargs):
    if argv is None:
        argv = sys.argv
    assert isinstance(default, bool), 'default must be boolean'
    argstr_list = meta_util_iter.ensure_iterable(argstr_)
    _register_arg(argstr_list, bool, default, help_)
    parsed_val = default
    was_specified = False
    if debug is None:
        debug = DEBUG
    import os
    #
    for key, val in os.environ.items():
        key = key.upper()
        sentinal = 'UTOOL_'
        if key.startswith(sentinal):
            flag = '--' + key[len(sentinal):].lower().replace('_', '-')
            if val.upper() in ['TRUE', 'ON']:
                pass
            elif val.upper() in ['FALSE', 'OFF']:
                continue
            else:
                continue
            new_argv = [flag]
            argv = argv[:] + new_argv
            if debug:
                print('ENV SPECIFIED COMMAND LINE')
                print('argv.extend(new_argv=%r)' % (new_argv,))
    for argstr in argstr_list:
        if not (argstr.find('--') == 0 or (argstr.find('-') == 0 and len(argstr) == 2)):
            raise AssertionError('Invalid argstr: %r' % (argstr,))
        if not need_prefix:
            noprefix = argstr.replace('--', '')
            if noprefix in argv:
                parsed_val = True
                was_specified = True
                break
        noarg = argstr.replace('--', '--no')
        if argstr in argv:
            parsed_val = True
            was_specified = True
            break
        elif noarg in argv:
            parsed_val = False
            was_specified = True
            break
        elif argstr + '=True' in argv:
            parsed_val = True
            was_specified = True
            break
        elif argstr + '=False' in argv:
            parsed_val = False
            was_specified = True
            break
    if return_specified is None:
        return_specified = return_was_specified
    if return_specified:
        return parsed_val, was_specified
    else:
        return parsed_val