#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" User-tracking tools for various wmf-related systems
Author: sbassett@wikimedia.org
License: Apache 2.0
"""

import argparse
import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))

from UserTracker import GerritTracker

""" Args """
parser = argparse.ArgumentParser()
parser.add_argument('-e', '--emails',
                    help='email or comma-separated \
                    list of emails to notify')
parser.add_argument('-d', '--emaildebug', default=False,
                    help='email debug flag')
parser.add_argument('-t', '--timeinterval', default='5m',
                    help='time interval corresponding to \
                    job frequency')
parser.add_argument('-u', '--gusername', default='',
                    help='gerrit username to track')
parser.add_argument('-i', '--guserid', default='',
                    help='gerrit user id to track \
                    (corresponds to --gusername)')
args, unknown = parser.parse_known_args()

""" Instantiate and send """
gt = GerritTracker(
    args.emails,
    args.emaildebug,
    args.timeinterval,
    args.gusername,
    args.guserid)

gt.send_alert()
