<commit_before>#!/usr/bin/env sh

echo_error() {
    echo "Usage: ${1} [-p property_string]"
    echo "Property strings have the following format:"
    echo "xxx.yyy.zzz=42;aaa.bbb=xyz;"
    exit 1
}

# place of the overrides file
overrides="/usr/local/tomcat/webapps/contacts/WEB-INF/overrides.properties"
props=""

opted=""

# Parsing opts
while getopts ":p:" OPTION "$@" ; do
    opted="1"
    case $OPTION in
        p)
            props="$OPTARG"
            ;;
        \?)
            echo "Unknown option: -$OPTARG"
            echo_error ${0##*/}
            ;;
        :)
            echo "Option requires an argument: -$OPTARG"
            echo_error ${0##*/}
            ;;
    esac
done

# If no opts were specifed
if [ -z "$opted" ]; then
    echo_error ${0##*/}
fi

# Parsing properties to overrides file
if [ -n "$props" ]; then
    echo > $overrides
    for prop in $(echo $props | tr ";" "\n"); do
        echo "$prop;" >> $overrides
    done
fi

# Uncomment if you wish to start a shell after running
/usr/bin/env bash<commit_msg>ELI-131: Entrypoint can also be run without opts<commit_after>#!/usr/bin/env sh

echo_error() {
    echo "Usage: ${1} [-p property_string]"
    echo "Property strings have the following format:"
    echo "xxx.yyy.zzz=42;aaa.bbb=xyz;"
    exit 1
}

# place of the overrides file
overrides="/usr/local/tomcat/webapps/contacts/WEB-INF/overrides.properties"
props=""

# Parsing opts
while getopts ":p:" OPTION "$@" ; do
    case $OPTION in
        p)
            props="$OPTARG"
            ;;
        \?)
            echo "Unknown option: -$OPTARG"
            echo_error ${0##*/}
            ;;
        :)
            echo "Option requires an argument: -$OPTARG"
            echo_error ${0##*/}
            ;;
    esac
done

# Parsing properties to overrides file
if [ -n "$props" ]; then
    echo > $overrides
    for prop in $(echo $props | tr ";" "\n"); do
        echo "$prop;" >> $overrides
    done
fi

# Uncomment if you wish to start a shell after running
/usr/bin/env bash
{'fraction_non_alphanumeric': 0.14257523433645783, 'fraction_numerical': 0.008386778490379871, 'mean_word_length': 2.1490683229813663, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 9, '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': '7434730', 'n_tokens_mistral': 686, 'n_tokens_neox': 667, 'n_words': 200}