local_quiet_cli: Silence '{cli}' output

View source: R/utils.R

local_quiet_cliR Documentation

Silence {cli} output

Description

Use for functions that use cli output that should optionally be suppressed.

Usage

local_quiet_cli(quiet, env = rlang::caller_env())

Examples


if (interactive()) {
  hello_rust <- function(..., quiet = FALSE) {
    local_quiet_cli(quiet)
    cli::cli_alert_info("This should be silenced when {.code quiet = TRUE}")
  }

  hello_rust()
  hello_rust(quiet = TRUE)
}

rextendr documentation built on July 9, 2023, 5:54 p.m.