# Path: mod/log.py
# RED = '\033[1;31m'
# GREEN = '\033[1;32m'
# YELLOW = '\033[1;33m'
# BLUE = '\033[1;36m'
# DEF = '\033[0;0m'
# def error(msg, fatal=True) :
# def warn(msg) :
# def ok(item, status) :
# def failed(item, status) :
# def optional(item, status) :
# def info(msg) :
# def colored(color, msg) :
# 
# Path: mod/util.py
# def fix_path(path) :
# def get_workspace_dir(fips_dir) :
# def get_project_dir(fips_dir, proj_name) :
# def get_build_root_dir(fips_dir, proj_name):
# def get_deploy_root_dir(fips_dir, proj_name):
# def get_build_dir(fips_dir, proj_name, cfg) :
# def get_deploy_dir(fips_dir, proj_name, cfg) :
# def get_fips_dir(proj_dir, name):
# def get_configs_dir(proj_dir):
# def get_verbs_dir(proj_dir):
# def get_generators_dir(proj_dir):
# def get_toolchains_dir(proj_dir):
# def get_giturl_from_url(url) :
# def get_gitbranch_from_url(url) :
# def get_project_name_from_url(url) :
# def get_project_name_from_dir(proj_dir) :
# def load_fips_yml(proj_dir) :
# def lookup_target_cwd(proj_dir, target) :
# def is_valid_project_dir(proj_dir) :
# def ensure_valid_project_dir(proj_dir) :
# def is_git_url(url) :
# def confirm(question) :
# def url_download_hook(count, block_size, total_size) :
# def get_host_platform() :
# def get_cfg_target_list(fips_dir, proj_dir, cfg):
# def get_cfg_headersdirs_by_target(fips_dir, proj_dir, cfg):
# def get_cfg_defines_by_target(fips_dir, proj_dir, cfg):
# def get_num_cpucores():
# 
# Path: mod/tools/vscode.py
# def try_exists(exe_name):
# def exe_name():
# def check_exists(fips_dir) :
# def match(build_tool):
# def run(proj_dir):
# def read_cmake_targets(fips_dir, proj_dir, cfg, types):
# def read_cmake_headerdirs(fips_dir, proj_dir, cfg):
# def read_cmake_defines(fips_dir, proj_dir, cfg):
# def problem_matcher():
# def get_cc_header_paths():
# def get_vs_header_paths(fips_dir, proj_dir, cfg):
# def list_extensions() :
# def write_tasks_json(fips_dir, proj_dir, vscode_dir, cfg):
# def write_launch_json(fips_dir, proj_dir, vscode_dir, cfg, proj_settings):
# def write_c_cpp_properties_json(fips_dir, proj_dir, impex, cfg):
# def write_cmake_tools_settings(fips_dir, proj_dir, vscode_dir, cfg):
# def write_code_workspace_file(fips_dir, proj_dir, impex, cfg):
# def remove_vscode_tasks_launch_files(fips_dir, proj_dir, impex, cfg):
# def write_workspace_settings(fips_dir, proj_dir, cfg, proj_settings):
# def cleanup(fips_dir, proj_dir):


from mod import log, util
from mod.tools import vscode
"""helper verb for VSCode support

vscode clean    -- removes all .vscode directories in all dependencies
"""

#-------------------------------------------------------------------------------
def run(fips_dir, proj_dir, args) :
    if not util.is_valid_project_dir(proj_dir) :
        log.error('must be run in a project directory')
    if len(args) > 0:
        if args[0] == 'clean':
            vscode.cleanup(fips_dir, proj_dir)
        else:
            log.error("invalid noun '{}' (expected: clean)".format(args[0]))

#-------------------------------------------------------------------------------
def help():

# Path: mod/log.py
# RED = '\033[1;31m'
# GREEN = '\033[1;32m'
# YELLOW = '\033[1;33m'
# BLUE = '\033[1;36m'
# DEF = '\033[0;0m'
# def error(msg, fatal=True) :
# def warn(msg) :
# def ok(item, status) :
# def failed(item, status) :
# def optional(item, status) :
# def info(msg) :
# def colored(color, msg) :
# 
# Path: mod/util.py
# def fix_path(path) :
# def get_workspace_dir(fips_dir) :
# def get_project_dir(fips_dir, proj_name) :
# def get_build_root_dir(fips_dir, proj_name):
# def get_deploy_root_dir(fips_dir, proj_name):
# def get_build_dir(fips_dir, proj_name, cfg) :
# def get_deploy_dir(fips_dir, proj_name, cfg) :
# def get_fips_dir(proj_dir, name):
# def get_configs_dir(proj_dir):
# def get_verbs_dir(proj_dir):
# def get_generators_dir(proj_dir):
# def get_toolchains_dir(proj_dir):
# def get_giturl_from_url(url) :
# def get_gitbranch_from_url(url) :
# def get_project_name_from_url(url) :
# def get_project_name_from_dir(proj_dir) :
# def load_fips_yml(proj_dir) :
# def lookup_target_cwd(proj_dir, target) :
# def is_valid_project_dir(proj_dir) :
# def ensure_valid_project_dir(proj_dir) :
# def is_git_url(url) :
# def confirm(question) :
# def url_download_hook(count, block_size, total_size) :
# def get_host_platform() :
# def get_cfg_target_list(fips_dir, proj_dir, cfg):
# def get_cfg_headersdirs_by_target(fips_dir, proj_dir, cfg):
# def get_cfg_defines_by_target(fips_dir, proj_dir, cfg):
# def get_num_cpucores():
# 
# Path: mod/tools/vscode.py
# def try_exists(exe_name):
# def exe_name():
# def check_exists(fips_dir) :
# def match(build_tool):
# def run(proj_dir):
# def read_cmake_targets(fips_dir, proj_dir, cfg, types):
# def read_cmake_headerdirs(fips_dir, proj_dir, cfg):
# def read_cmake_defines(fips_dir, proj_dir, cfg):
# def problem_matcher():
# def get_cc_header_paths():
# def get_vs_header_paths(fips_dir, proj_dir, cfg):
# def list_extensions() :
# def write_tasks_json(fips_dir, proj_dir, vscode_dir, cfg):
# def write_launch_json(fips_dir, proj_dir, vscode_dir, cfg, proj_settings):
# def write_c_cpp_properties_json(fips_dir, proj_dir, impex, cfg):
# def write_cmake_tools_settings(fips_dir, proj_dir, vscode_dir, cfg):
# def write_code_workspace_file(fips_dir, proj_dir, impex, cfg):
# def remove_vscode_tasks_launch_files(fips_dir, proj_dir, impex, cfg):
# def write_workspace_settings(fips_dir, proj_dir, cfg, proj_settings):
# def cleanup(fips_dir, proj_dir):


# Path: verbs/vscode.py
from mod import log, util
from mod.tools import vscode

"""helper verb for VSCode support

vscode clean    -- removes all .vscode directories in all dependencies
"""

#-------------------------------------------------------------------------------
def run(fips_dir, proj_dir, args) :
    if not util.is_valid_project_dir(proj_dir) :
        log.error('must be run in a project directory')
    if len(args) > 0:
        if args[0] == 'clean':
            vscode.cleanup(fips_dir, proj_dir)
        else:
            log.error("invalid noun '{}' (expected: clean)".format(args[0]))

#-------------------------------------------------------------------------------
def help():

    log.info(log.YELLOW +