#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Visual Studio Code settings synchronizer - Synchronize vscode settings and
extensions with your dotfiles directory.
"""

import argparse
import os
import os.path as path
import sys
import subprocess
import shutil

from codecs import open
from typing import List

VSCODE_DOTFILES_PREFIX = 'Code/user'
DOTFILES = os.path.join(os.path.expanduser('~'), '.dotfiles')
EXTENSION_FILE = os.path.join(DOTFILES, VSCODE_DOTFILES_PREFIX, 'extensions.txt')


def main():
    """
    Main entry point for the sync vscode settings script.
    """

    desc = 'Synchronize vscode settings and extensions with your dotfiles directory.'
    usage = 'sync_vscode_settings [<args>]'
    epilog = ''
    arg_parser = argparse.ArgumentParser(description=desc, usage=usage, epilog=epilog)

    _help = 'Synchronize vscode settings and extensions like the arguments -e -l.'
    _action = 'store_true'
    arg_parser.add_argument('-s', '--sync', default=False, help=_help, action=_action)

    _help = 'Moves your settings into the dotfiles and replace it with links.'
    _action = 'store_true'
    arg_parser.add_argument('-l', '--link', default=False, help=_help, action=_action)