Auto detect capfile