#!/usr/bin/env python3

import sys
from pathlib import Path

import opa
import yaml

if len(sys.argv) < 2:
    print("Usage: ib2influx config.yml")
else:
    config_file = Path(sys.argv[1])
    if config_file.is_file():
        with open(config_file, "r") as f:
            config = yaml.safe_load(f)
    else:
        raise FileNotFoundError

    opa.LoaderOPA(config)
