Append --environment flag only if required