Add a check to this function that looks if `p[1]` is an option and equal to the boolean options (I think it is just "collapse" in this case) and sets the type of `p[3]` accordingly. (See the other things I've checked in recently that check boolean options as an example.)