Quiet progress bars - #840
Conversation
|
The CI is failing because you need to regenerate the documentation ( |
|
|
Fix in #839 pending @gaborcsardi approval. |
| #' bar of the calling function. See more at 'The current progress bar' | ||
| #' below. | ||
| #' @param quiet if `TRUE` suppresses output from this function. Defaults to the `cli.disable_progress` option, or | ||
| #' `TRUE` if unset. |
There was a problem hiding this comment.
The docs still say 'TRUE' or am I missing something here?
| clienv$progress[[id]] <- bar | ||
| if (current) { | ||
| if (!is.null(clienv$progress_ids[[envkey]])) { | ||
| if (!is.null(clienv$progress_ids[[envkey]]) && !quiet) { |
There was a problem hiding this comment.
This does not seem correct to me. If we are creating a new progress bar, then that should be the current progress bar, whether it is quiet or not.
|
I guess we can merge it and improve it later |
|
Thanks! |
| envir = .envir | ||
| ) | ||
| } | ||
| if(!quiet){ |
There was a problem hiding this comment.
[air] reported by reviewdog 🐶
| if(!quiet){ | |
| if (!quiet) { |
|
|
||
| fun <- function() { | ||
| bar <- cli_progress_bar( | ||
| name = "name", | ||
| quiet = TRUE | ||
| ) | ||
| for (i in 1:100) { | ||
| Sys.sleep(5/100) | ||
| cli_progress_update(id = bar) | ||
| } |
There was a problem hiding this comment.
[air] reported by reviewdog 🐶
| fun <- function() { | |
| bar <- cli_progress_bar( | |
| name = "name", | |
| quiet = TRUE | |
| ) | |
| for (i in 1:100) { | |
| Sys.sleep(5/100) | |
| cli_progress_update(id = bar) | |
| } | |
| fun <- function() { | |
| bar <- cli_progress_bar( | |
| name = "name", | |
| quiet = TRUE | |
| ) | |
| for (i in 1:100) { | |
| Sys.sleep(5 / 100) | |
| cli_progress_update(id = bar) |
| cli_progress_update(id = bar) | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
[air] reported by reviewdog 🐶
| } | |
| # No messages to display | ||
| expect_snapshot(capture_cli_messages(fun())) | ||
| }) | ||
|
|
There was a problem hiding this comment.
[air] reported by reviewdog 🐶
| # No messages to display | |
| expect_snapshot(capture_cli_messages(fun())) | |
| }) | |
| # No messages to display | |
| expect_snapshot(capture_cli_messages(fun())) | |
| }) |
Fix issue #645 by adding an argument
quietto suppress progress bar when quiet = FALSE.