# Path: alertaclient/utils.py
# def build_query(filters):
#     return [tuple(f.split('=', 1)) for f in filters if '=' in f]


import click
from alertaclient.utils import build_query



@click.command('tag', short_help='Tag alerts')
@click.option('--ids', '-i', metavar='ID', multiple=True, help='List of alert IDs (can use short 8-char id)')
@click.option('--query', '-q', 'query', metavar='QUERY', help='severity:"warning" AND resource:web')
@click.option('--filter', '-f', 'filters', metavar='FILTER', multiple=True, help='KEY=VALUE eg. serverity=warning resource=web')

# Path: alertaclient/utils.py
# def build_query(filters):
#     return [tuple(f.split('=', 1)) for f in filters if '=' in f]


# Path: alertaclient/commands/cmd_tag.py
import click
from alertaclient.utils import build_query




@click.command('tag', short_help='Tag alerts')
@click.option('--ids', '-i', metavar='ID', multiple=True, help='List of alert IDs (can use short 8-char id)')
@click.option('--query', '-q', 'query', metavar='QUERY', help='severity:"warning" AND resource:web')
@click.option('--filter', '-f', 'filters', metavar='FILTER', multiple=True, help='KEY=VALUE eg. serverity=warning resource=web')

@click.option('--tag', '-T', 'tags', required=True, multiple=True, help='List of tags')