Skip to content

Commit a446257

Browse files
committed
Only show message if at least one function has the decoration
1 parent a0beb5b commit a446257

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

R/register.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ get_registered_functions <- function(decorations, tag, quiet = FALSE) {
115115
out <- out[!(names(out) %in% "functions")]
116116
out$decoration <- sub("::[[:alpha:]]+", "", out$decoration)
117117

118-
if (!quiet) {
119-
cli::cli_alert_info(glue::glue("{n} functions decorated with [[{tag}]]", n = nrow(out)))
118+
n <- nrow(out)
119+
120+
if (!quiet && n > 0) {
121+
cli::cli_alert_info(glue::glue("{n} functions decorated with [[{tag}]]"))
120122
}
121123

122124
out

0 commit comments

Comments
 (0)