#!/usr/bin/env python
import sys
from theano import config
from theano.gof.cc import get_module_cache

if len(sys.argv) == 1:
    print config.compiledir
elif sys.argv[1] in ('clear'):
    get_module_cache().clear(unversioned_min_age=-1, clear_base_files=True)
else:
    print 'command "%s" not recognized' % sys.argv[1]
    print 'Type "theano-cache" to print the cache location'
    print 'Type "theano-cache clear" to erase the cache'
    sys.exit(1)

