Skip to contents

Version of cli::cli_progress_step() that for the messages on (un)successful termination simply appends done/failed to msg.

Usage

cli_progress_step_quick(
  msg,
  spinner = FALSE,
  class = if (!spinner) ".alert-info",
  current = TRUE,
  .auto_close = TRUE,
  .envir = parent.frame()
)

Arguments

msg

Message to show. It may contain glue substitution and cli styling. It can be updated via cli_progress_update(), as usual. It is style as a cli info alert (see cli_alert_info()).

spinner

Whether to show a spinner at the beginning of the line. To make the spinner spin, you'll need to call cli_progress_update() regularly.

class

cli class to add to the message. By default there is no class for steps with a spinner.

current

Whether to use this progress bar as the current progress bar of the calling function. See more at 'The current progress bar' below.

.auto_close

Whether to terminate the progress bar when the calling function (or the one with execution environment in .envir exits. (Auto termination does not work for progress bars created from the global environment, e.g. from a script.)

.envir

The environment to use for auto-termination and for glue substitution. It is also used to find and set the current progress bar.

Value

The cli progress bar id as a character scalar, invisibly.

See also

Other functions extending the cli package: cli_process_expr(), cli_qty_lgl()

Examples

{
  pal::cli_progress_step_quick(msg = "Doing my thing")
  Sys.sleep(1)
  cli::cli_progress_done()
}
#>  Doing my thing…
#>  Doing my thing… done [1s]
#>