Make diff flags handling more modular.