#! /usr/bin/python
"""
Driver program for L1-mock.
"""

import argparse
import sys
import logging

import yaml

from ch_L1mock import manager


logger = logging.getLogger(__name__)

logging.basicConfig(level=logging.INFO)


main_parser = argparse.ArgumentParser(
        description="Run the CHIME FRB L1 processing mock-up.",
        )

main_parser.add_argument("config_file",
        type=str,
        metavar="config.yaml",
        help="Configuration file in YAML format. See examples.",
        )


def main(p):

    args = p.parse_args()
    with open(args.config_file) as f:
        m = manager.Manager(yaml.load(f))
    m.run()


if __name__ == "__main__":
    main(main_parser)


