Add a boolean argument to an ArgumentParser instance.

def add_boolean_argument(parser, name, default=False):
    """Add a boolean argument to an ArgumentParser instance."""
    group = parser.add_mutually_exclusive_group()
    group.add_argument('--set',  action='store_true', dest=name,
                       default=default)
    group.add_argument('--unset', action='store_false', dest=name,
                       default=default)