options::define_options(
"whether messages should be written softly, or in all-caps",
quiet = TRUE
)
#' Hello, World
#'
#' @eval options::as_params("softly" = "quiet")
#'
hello <- function(who, softly = opt("quiet")) {
say_what <- paste0("Hello, ", who, "!")
if (quiet) say_what else toupper(say_what)
}
Run the code above in your browser using DataLab