def add_bool(flagname, default=True, **kwargs):
    """Add a bool flag name and its setting.

    :param flagname: flag name declared in cmd as --[no]<flagname>.
    :type flagname: str
    :param default: default value
    :type default: bool
    """
    Flags.PARSER.add_option('--%s' % flagname,
                            dest=flagname, default=default,
                            action="store_true", **kwargs)
    Flags.PARSER.add_option('--no%s' % flagname,
                            dest=flagname,
                            action="store_false", **kwargs)
dataset/ETHPy150Open openstack/compass-core/compass/utils/flags.py/add_bool/original