Created initWithFile func as callback from cobra;