#!/usr/bin/env python

""" 
Command-line interface for bugzilla2gitlab.
"""

import argparse
from bugzilla2gitlab import Migrator

def main():
    parser = argparse.ArgumentParser(description='Migrate bugs from Bugzilla to GitLab Issues.')
    parser.add_argument('bug_list', metavar="BUGLIST",
                        help="A file containing a list of Bugzilla bug numbers to migrate,"
                        " one per line.")
    parser.add_argument("conf_dir", metavar='CONFIG_DIRECTORY',
                        help="The directory containing the required configuration files.")
    args = parser.parse_args()

    with open(args.bug_list, "r") as f:
        bugs = f.read().splitlines()

    client = Migrator(config_path=args.conf_dir)
    client.migrate(bugs)

if __name__ == "__main__":
    main()
