Allow dirname to be an option