<filename>mcsf/__main__.py
import argparse
import logging
import os

from mcsf.commands.configure import ConfigureCommand
from mcsf.commands.down import DownCommand
from mcsf.commands.list_servers import ListCommand
from mcsf.commands.up import UpCommand

if __name__ == "__main__":
    logging.basicConfig(level=logging.INFO)

    config_dir = os.path.join(os.path.expanduser('~'), '.config', 'mcsf')
    if not os.path.isdir(config_dir):
        os.makedirs(config_dir)

    parser = argparse.ArgumentParser('mcsf', description='MINECRAFT SERVER, FAST!')

    parser.add_argument('command', type=str)
    parser.add_argument('--alias', type=str, action='store', default='mcsf_Default')

    args = parser.parse_args()

    command = {
        'up': UpCommand,
        'down': DownCommand,
        'configure': ConfigureCommand,
        'list': ListCommand
    }

    command[args.command]().handle(args)
