#autoload

#Define global values
if (( ! $+GRIMOIRE_DIR )); then
    typeset `grep " GRIMOIRE_LIST=" /etc/sorcery/config`
    typeset -gA GRIMOIRE_DIR
    . $GRIMOIRE_LIST
fi

# load spell's list
typeset _spells_list
for i in $GRIMOIRE_DIR
_spells_list=(
    $_spells_list
    $(cut --delimiter=" " -f 1 $i/codex.index)
)

# Check are there spells, or not.
if [[ "$_spells_list" != . ]]; then
    compadd -P '' $_spells_list
else
    false
fi
