factored enum.{print,print_at_most} into a common function