Description Usage Arguments Details Value See Also
The status bar is the last line of the terminal. cli apps can use this to show status information, progress bars, etc. The status bar is kept intact by all semantic cli output.
1 2 3 4 5 6 7 8 9 | cli_status(
msg,
msg_done = paste(msg, "... done"),
msg_failed = paste(msg, "... failed"),
.keep = FALSE,
.auto_close = TRUE,
.envir = parent.frame(),
.auto_result = c("clear", "done", "failed", "auto")
)
|
msg |
The text to show, a character vector. It will be
collapsed into a single string, and the first line is kept and cut to
|
msg_done |
The message to use when the message is cleared, when
the calculation finishes successfully. If |
msg_failed |
The message to use when the message is cleared, when
the calculation finishes unsuccessfully. If |
.keep |
What to do when this status bar is cleared. If |
.auto_close |
Whether to clear the status bar when the calling function finishes (or ‘.envir’ is removed from the stack, if specified). |
.envir |
Environment to evaluate the glue expressions in. It is
also used to auto-clear the status bar if |
.auto_result |
What to do when auto-closing the status bar. |
Use cli_status_clear()
to clear the status bar.
Often status messages are associated with processes. E.g. the app starts
downloading a large file, so it sets the status bar accordingly. Once the
download is done (or has failed), the app typically updates the status bar
again. cli automates much of this, via the msg_done
, msg_failed
, and
.auto_result
arguments. See examples below.
The id of the new status bar container element, invisibly.
cli_process_start()
for a higher level interface to the
status bar, that adds automatic styling.
Other status bar:
cli_process_start()
,
cli_status_clear()
,
cli_status_update()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.