<commit_before>#!/bin/bash

options() {
cat << EOF
OPTIONS:
-h    Displays this help message
-f    Font name as it appears in ~/.magick/type.xml
-s    Font size
-t    Text to glitter
-g    Glitter to mask
EOF
}

directions() {
cat << EOF
Please create list of system font list
Refer to README on imagick_type_gen.pl usage
EOF
}

# Script dir
pushd `dirname $0` > /dev/null
	dir="$(dirname `pwd`)"
popd > /dev/null

# Get arguments
while getopts "hf:s:t:g:" option
do
	case "$option" in
		h)
			options
			exit
			;;
		f)
			font="$optarg"
			;;
		s)
			size="$optarg"
			;;
		t)
			text="$optarg"
			;;
		g)
			background="$optarg"
			;;
	esac
done

# If text isn't, die
if [[ -z $text ]]
then
	options
	exit
fi

# Try to create font list if doesn't exit
font_list=~/.magick/type.xml
system_fonts=/Library/Fonts
if [[ ! -f "$font_list" ]]; then
	if [[ ! -d "$system_fonts" ]]
		then
		directions
		exit
	fi

	# Create font list directory
	$(mkdir `dirname "$font_list"`)

	# Generate font list
	$(find $system_fonts -name *.ttf -o -name *.otf | \
		$dir/bin/imagick_type_gen.pl -f - > $font_list)
fi
<commit_msg>OPTARG needs to be uppercase<commit_after>#!/bin/bash

options() {
cat << EOF
OPTIONS:
-h    Displays this help message
-f    Font name as it appears in ~/.magick/type.xml
-s    Font size
-t    Text to glitter
-g    Glitter to mask
EOF
}

directions() {
cat << EOF
Please create list of system font list
Refer to README on imagick_type_gen.pl usage
EOF
}

# Script dir
pushd `dirname $0` > /dev/null
	dir="$(dirname `pwd`)"
popd > /dev/null

# Get arguments
while getopts "hf:s:t:g:" option
do
	case "$option" in
		h)
			options
			exit
			;;
		f)
			font="$OPTARG"
			;;
		s)
			size="$OPTARG"
			;;
		t)
			text="$OPTARG"
			;;
		g)
			background="$OPTARG"
			;;
	esac
done

# If text isn't, die
if [[ -z $text ]]
then
	options
	exit
fi

# Try to create font list if doesn't exit
font_list=~/.magick/type.xml
system_fonts=/Library/Fonts
if [[ ! -f "$font_list" ]]; then
	if [[ ! -d "$system_fonts" ]]
		then
		directions
		exit
	fi

	# Create font list directory
	$(mkdir `dirname "$font_list"`)

	# Generate font list
	$(find $system_fonts -name *.ttf -o -name *.otf | \
		$dir/bin/imagick_type_gen.pl -f - > $font_list)
fi

{'fraction_non_alphanumeric': 0.14292094685127288, 'fraction_numerical': 0.0008932559178204555, 'mean_word_length': 2.8956521739130436, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '3783457', 'n_tokens_mistral': 969, 'n_tokens_neox': 874, 'n_words': 270}