<commit_before>#!/bin/bash -e

##################
# IMPLEMENTATION #
##################

function displayUsage()
{
    local -r scriptName="$(basename "${BASH_SOURCE[0]}")"

    echo -e '\033[1;33m'
    echo    'SYNOPSIS :'
    echo    "  ${scriptName}"
    echo    '    --help'
    echo    '    --application-name    <APPLICATION_NAME>'
    echo    '    --cask-application    <CASK_APPLICATION>'
    echo -e '\033[1;35m'
    echo    'DESCRIPTION :'
    echo    '  --help                Help page (optional)'
    echo    '  --application-name    Application name to be uninstalled (require)'
    echo    '  --cask-application    If application is cask application or not (optional)'
    echo    "                        Value could be 'true' or 'false'. Defualt to 'false'"
    echo -e '\033[1;36m'
    echo    'EXAMPLES :'
    echo    "  ./${scriptName} --help"
    echo    "  ./${scriptName} --application-name 'java' --cask-application 'true'"
    echo    "  ./${scriptName} --application-name 'tree'"
    echo -e '\033[0m'

    exit "${1}"
}

function uninstall()
{
    local -r applicationName="${1}"
    local -r caskApplication="${2}"

    checkExistCommand 'brew'

    if [[ "${caskApplication}" = 'true' ]]
    then
        brew cask uninstall "${applicationName}" || true
    else
        brew uninstall "${applicationName}" || true
    fi
}

########
# MAIN #
########

function main()
{
    source "$(dirname "${BASH_SOURCE[0]}")/../libraries/util.bash"

    # Parsing Command Arguments<commit_msg>bug fixes<commit_after>#!/bin/bash -e

##################
# IMPLEMENTATION #
##################

function displayUsage()
{
    local -r scriptName="$(basename "${BASH_SOURCE[0]}")"

    echo -e '\033[1;33m'
    echo    'SYNOPSIS :'
    echo    "  ${scriptName}"
    echo    '    --help'
    echo    '    --application-name    <APPLICATION_NAME>'
    echo    '    --cask-application    <CASK_APPLICATION>'
    echo -e '\033[1;35m'
    echo    'DESCRIPTION :'
    echo    '  --help                Help page (optional)'
    echo    '  --application-name    Application name to be uninstalled (require)'
    echo    '  --cask-application    If application is cask application or not (optional)'
    echo    "                        Value could be 'true' or 'false'. Defualt to 'false'"
    echo -e '\033[1;36m'
    echo    'EXAMPLES :'
    echo    "  ./${scriptName} --help"
    echo    "  ./${scriptName} --application-name 'java' --cask-application 'true'"
    echo    "  ./${scriptName} --application-name 'tree'"
    echo -e '\033[0m'

    exit "${1}"
}

function uninstall()
{
    local -r applicationName="${1}"
    local -r caskApplication="${2}"

    checkExistCommand 'brew'

    if [[ "${caskApplication}" = 'true' ]]
    then
        brew cask uninstall "${applicationName}" || true
    else
        brew uninstall "${applicationName}" || true
    fi

    brew cleanup
}

########
# MAIN #
########

function main()
{
    source "$(dirname "${BASH_SOURCE[0]}")/../libraries/util.bash"

    # Parsing Command Arguments
{'fraction_non_alphanumeric': 0.1825972313777192, 'fraction_numerical': 0.017798286090969017, 'mean_word_length': 2.3025027203482047, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7644063', 'n_tokens_mistral': 1006, 'n_tokens_neox': 959, 'n_words': 240}