<commit_before># Set this to 1 if you want to cache the tasks
cacheTaskList=1

# Cache filename
cacheFile='.cake-task-cache'

_cake_does_target_list_need_generating () {

	if [ $cacheTaskList -eq 0 ]; then
		return 1;
	fi

	if [ ! -f $cacheFile ]; then return 0;
	else
		accurate=$(stat -f%m $cacheFile)
		changed=$(stat -f%m Cakefile)
		return $(expr $accurate '>=' $changed)
	fi
}

_cake () {
	if [ -f Cakefile ]; then
		if _cake_does_target_list_need_generating; then
			cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$' > $cacheFile
			compadd `cat $cacheFile`
		else
			compadd `cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$'`
		fi
	fi
}

compdef _cake cake<commit_msg>Bringing inline with oh-my-zsh coding convensions<commit_after># Set this to 1 if you want to cache the tasks
cache_task_list=1

# Cache filename
cache_file='.cake_task_cache'

_cake_does_target_list_need_generating () {

	if [ $cache_task_list -eq 0 ]; then
		return 1;
	fi

	if [ ! -f $cache_file ]; then return 0;
	else
		accurate=$(stat -f%m $cache_file)
		changed=$(stat -f%m Cakefile)
		return $(expr $accurate '>=' $changed)
	fi
}

_cake () {
	if [ -f Cakefile ]; then
		if _cake_does_target_list_need_generating; then
			cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$' > $cache_file
			compadd `cat $cache_file`
		else
			compadd `cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$'`
		fi
	fi
}

compdef _cake cake
{'fraction_non_alphanumeric': 0.16208597603946442, 'fraction_numerical': 0.009866102889358703, 'mean_word_length': 3.2771084337349397, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5272496', 'n_tokens_mistral': 633, 'n_tokens_neox': 563, 'n_words': 156}