#!/usr/bin/env python3

import argparse

from assistant import constants, questions, todos, utils

arg_parser = argparse.ArgumentParser(description="Runs personal commit assistant.")
arg_parser.add_argument("task", choices=["question", "todo", "clear", "rotate", "init"], default="question")
arg_parser.add_argument("--config", "-c", default=".assistant.ini")

args = arg_parser.parse_args()
if args.task == "question":
    questions.run_questionnaire(args.config)
    todos.run_todo()
elif args.task == "todo":
    todos.run_todo()
elif args.task == "clear":
    utils.clear_files_for_commit()
elif args.task == "rotate":
    utils.rotate_files()
elif args.task == "init":
    utils.init_assistant_file()
elif args.task == "create-hook":
    utils.setup_pre_commit()
elif args.task == "destroy":
    utils.remove_assistant()
