#!/usr/bin/env python

import argparse
import logging

from src.cli import setup_vectra_module, run_vectra_module

logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s')
log = logging.getLogger('cyjax-vectra')
console_handler = logging.StreamHandler()

parser = argparse.ArgumentParser(
    description='Pull indicators of compromise from Cyjax Threat Intelligence platform and store them in Vectra.')
parser.add_argument('-s', '--setup', help='set the input module up', action='store_true')
parser.add_argument('-r', '--run', help='run the input module', action='store_true')
parser.add_argument('-d', '--debug', help='turn debug on', action='store_true')

args = parser.parse_args()

log.setLevel(logging.DEBUG if args.debug else logging.INFO)

if 'setup' in args and args.setup:
    # Setup the module
    setup_vectra_module()
else:
    # Run the module
    run_vectra_module()
