[PATCH v3 3/3] cli: compile history code if and only if history config is selected