% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cli.R
\name{cli_fmt}
\alias{cli_fmt}
\title{Capture the output of cli functions instead of printing it}
\usage{
cli_fmt(expr, collapse = FALSE, strip_newline = FALSE)
}
\arguments{
\item{expr}{Expression to evaluate, containing \verb{cli_*()} calls,
typically.}

\item{collapse}{Whether to collapse the output into a single character
scalar, or return a character vector with one element for each line.}

\item{strip_newline}{Whether to strip the trailing newline.}
}
\description{
Capture the output of cli functions instead of printing it
}
\examples{
cli_fmt({
  cli_alert_info("Loading data file")
  cli_alert_success("Loaded data file")
})
}
