diff --git a/R/progress-client.R b/R/progress-client.R index 93612451..edae4463 100644 --- a/R/progress-client.R +++ b/R/progress-client.R @@ -216,6 +216,11 @@ #' like the elapsed time, of the ETA manually. You can also use your own #' variables in the calling function: #' +#' To leave a completion or failure message on screen after the progress bar +#' finishes, set `clear = FALSE` and customize `format_done` and +#' `format_failed`. The `pb_elapsed` variable is often useful for reporting the +#' total runtime. +#' #' ```{asciicast progress-format} #' #| asciicast_at = "all", #' #| asciicast_knitr_output = "svg", @@ -230,6 +235,9 @@ #' "{col_green(symbol$tick)} Downloaded {pb_total} files ", #' "in {pb_elapsed}." #' ), +#' format_failed = paste0( +#' "{col_red(symbol$cross)} Download failed after {pb_elapsed}." +#' ), #' clear = FALSE, #' total = length(urls) #' ) diff --git a/man/cli_progress_bar.Rd b/man/cli_progress_bar.Rd index fcdd96ae..b28bfb92 100644 --- a/man/cli_progress_bar.Rd +++ b/man/cli_progress_bar.Rd @@ -337,6 +337,11 @@ are probably useful to avoid calculating some progress bar quantities like the elapsed time, of the ETA manually. You can also use your own variables in the calling function: +To leave a completion or failure message on screen after the progress bar +finishes, set \code{clear = FALSE} and customize \code{format_done} and +\code{format_failed}. The \code{pb_elapsed} variable is often useful for reporting the +total runtime. + \if{html}{\out{