def get_filters(filters):
    """Return the rsync options for the given filters."""
    arguments = []
    for filter_ in filters:
        if len(filter_) > 1:
            raise Exception('Filter must contain only one entry: {}'.format
                (filter_))
        if 'exclude' in filter_:
            arguments += ['--exclude', filter_['exclude']]
        elif 'include' in filter_:
            arguments += ['--include', filter_['include']]
        else:
            raise Exception('Filter must contain include or exclude: {}'.
                format(filter_))
    return arguments
