From 3296ce472036dc7e6c738fc74447f769ff03edc5 Mon Sep 17 00:00:00 2001 From: Chris Toney Date: Sun, 29 Mar 2026 22:12:30 -0600 Subject: [PATCH] progress_r: format the cli progress bar --- src/progress_r.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/progress_r.cpp b/src/progress_r.cpp index 9a83a328a..35435ed90 100644 --- a/src/progress_r.cpp +++ b/src/progress_r.cpp @@ -4,6 +4,12 @@ static SEXP global_pb = R_NilValue; +static const Rcpp::List pb_config = + Rcpp::List::create( + Rcpp::Named("format_done") = "{cli::col_green(cli::symbol$tick)} " + "Done ({cli::pb_elapsed})", + Rcpp::Named("clear") = false); + int CPL_STDCALL GDALTermProgressR(double dfComplete, CPL_UNUSED const char *pszMessage, CPL_UNUSED void *pProgressArg) @@ -13,7 +19,7 @@ int CPL_STDCALL GDALTermProgressR(double dfComplete, cli_progress_done(global_pb); R_ReleaseObject(global_pb); - global_pb = cli_progress_bar(1, NULL); + global_pb = cli_progress_bar(1, pb_config); R_PreserveObject(global_pb); } else if (dfComplete < 1) {