

def main():
    parser = argparse.ArgumentParser(description='Execute elastic-recheck query files and analyze the results.')
    parser.add_argument('query_file', type=argparse.FileType('r'), help='Path to an elastic-recheck YAML query file.')
    parser.add_argument('--quantity', '-q', type=int, default=DEFAULT_MAX_QUANTITY, help='Maximum quantity of values to show for each attribute.')
    parser.add_argument('--days', '-d', type=float, default=DEFAULT_NUMBER_OF_DAYS, help='Timespan to query, in days (may be a decimal).')
    parser.add_argument('--verbose', '-v', action='store_true', default=False, help='Report on additional query metadata.')
    parser.add_argument('-c', '--conf', help='Elastic Recheck Configuration file to use for data_source options such as elastic search url, logstash url, and database uri.')
    args = parser.parse_args()
    es_url = er.ES_URL
    if args.conf:
        config = ConfigParser.ConfigParser({
            'es_url': er.ES_URL,
        })
        config.read(args.conf)
        if config.has_section('data_source'):
            es_url = config.get('data_source', 'es_url')
    query(args.query_file.name, days=args.days, quantity=args.quantity, verbose=args.verbose, es_url=es_url)

dataset/ETHPy150Open openstack-infra/elastic-recheck/elastic_recheck/cmd/query.py main/original