cli (version 2.0.1)

cli_alert: CLI alerts

Description

Alerts are typically short status messages.

Usage

cli_alert(text, id = NULL, class = NULL, wrap = FALSE, .envir = parent.frame())

cli_alert_success( text, id = NULL, class = NULL, wrap = FALSE, .envir = parent.frame() )

cli_alert_danger( text, id = NULL, class = NULL, wrap = FALSE, .envir = parent.frame() )

cli_alert_warning( text, id = NULL, class = NULL, wrap = FALSE, .envir = parent.frame() )

cli_alert_info( text, id = NULL, class = NULL, wrap = FALSE, .envir = parent.frame() )

Arguments

text

Text of the alert.

id

Id of the alert element. Can be used in themes.

class

Class of the alert element. Can be used in themes.

wrap

Whether to auto-wrap the text of the alert.

.envir

Environment to evaluate the glue expressions in.

Examples

Run this code
# NOT RUN {
cli_alert("Cannot lock package library.")
cli_alert_success("Package {.pkg cli} installed successfully.")
cli_alert_danger("Could not download {.pkg cli}.")
cli_alert_warning("Internet seems to be unreacheable.")
cli_alert_info("Downloaded 1.45MiB of data")
# }

Run the code above in your browser using DataLab