#!python
"""LICENSE
Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>

This file is part of bundesliga-tippspiel.

bundesliga-tippspiel is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

bundesliga-tippspiel is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with bundesliga-tippspiel.  If not, see <http://www.gnu.org/licenses/>.
LICENSE"""

import argparse
from betbot import sentry_dsn
from betbot.prediction import predictors
from betbot.main import main as betbot_main
from puffotter.init import cli_start, argparse_add_verbosity


def main(args: argparse.Namespace):
    """
    The main function of the betbot
    :param args: The command line arguments
    :return: None
    """
    betbot_main(args.predictor, args.username, args.password, args.url)


if __name__ == "__main__":
    parser = argparse.ArgumentParser()

    predictor_names = {x.name() for x in predictors}
    parser.add_argument("predictor", choices=predictor_names)
    parser.add_argument("username")
    parser.add_argument("password")
    parser.add_argument("url", default="https://hk-tippspiel.com")

    argparse_add_verbosity(parser)
    cli_start(main, parser, "Thanks for using betbot", "betbot", sentry_dsn)
