R/check_log_sort.R

Defines functions check_log_sort

Documented in check_log_sort

#' Check if the supplied \code{sort} is a valid logging sorting option.
#' @param sort how to sort the entries in a log.
#' Valid are \code{smart}, \code{none} and \code{alphabetic}
#' @return No return value, called for side effects
#' @export
check_log_sort <- function(sort) {
  if (!sort %in% get_log_sorts()) {
    stop(
      "'sort' must be a valid log sort. \n",
      "Supported values: '",
      paste0(get_log_sorts(), collapse = ", "), "' \n",
      "Actual value: '", sort
    )
  }
  invisible(sort)
}

Try the beautier package in your browser

Any scripts or data that you put into this service are public.

beautier documentation built on Nov. 2, 2023, 5:08 p.m.