GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • cli
  • FAQ
  • Reference
  • Building a Semantic CLI
  • From usethis::ui functions to cli
  • cli pluralization
  • Introduction to progress bars in cli
  • Advanced cli progress bars
  • cli color palettes
  • More articles...
  • Changelog

This view

  • Original page
  • New address

GeezerVison is showing cli.r-lib.org — Simplified cli progress messages — cli_progress_message

Simplified cli progress messages

Source: R/progress-client.R
cli_progress_message.Rd

This is a simplified progress bar, a single (dynamic) message, without progress units.

Usage

cli_progress_message(
  msg,
  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.

current

Passed to cli_progress_bar().

.auto_close

Passed to cli_progress_bar().

.envir

Passed to cli_progress_bar().

...

Passed to cli_progress_bar().

Value

The id of the new progress bar.

Details

cli_progress_message() always shows the message, even if no update is due. When the progress message is terminated, it is removed from the screen by default.

Note that the message can be dynamic: if you update it with cli_progress_update(), then cli uses the current values in the string substitutions.

fun <- function() {
  cli_progress_message("Task one is running...")
  Sys.sleep(2)

  cli_progress_message("Task two is running...")
  Sys.sleep(2)

  step <- 1L
  cli_progress_message("Task three is underway: step {step}")
  for (step in 1:5) {
    Sys.sleep(0.5)
    cli_progress_update()
  }
}
fun()

See also

This function supports inline markup.

cli_progress_bar() for the complete progress bar API. cli_progress_step() for a similar display that is styled by default.

Other progress bar functions: cli_progress_along(), cli_progress_bar(), cli_progress_builtin_handlers(), cli_progress_num(), cli_progress_output(), cli_progress_step(), cli_progress_styles(), progress-variables

Other functions supporting inline markup: cli_abort(), cli_alert(), cli_blockquote(), cli_bullets(), cli_bullets_raw(), cli_dl(), cli_h1(), cli_li(), cli_ol(), cli_process_start(), cli_progress_along(), cli_progress_bar(), cli_progress_output(), cli_progress_step(), cli_rule, cli_status(), cli_status_update(), cli_text(), cli_ul(), format_error(), format_inline()

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.