#!/usr/bin/env python

import argparse
import os
import re
from pydoc import locate
from databeaver import DataBeaver


def main():
    """
    Command Line Script for the data_beaver module


    Command Line Usage
        ./fbb.py <action> - General Format

    Responsible For
        1. Parsing Command Line Arguments
        2. Validating the action requested is a valid action
        3. Calling the run() method of the requested action
    :return:
    """
    # TODO: Get a better tag line
    desc = "Data Beaver - Building your Data Warehouse... One Table At A Time"
    print(desc)
    parser = argparse.ArgumentParser(description=desc)
    parser.add_argument('action')
    args = parser.parse_known_args()[0]

    beaver = DataBeaver()
    if args.action == 'build':
        beaver.build()
    elif args.action == 'dependencies':
        beaver.model_dependencies()
    elif args.action == 'destroy':
        beaver.destroy()

# Base Call
main()
