% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/arg_dots_supplied.R
\name{arg_dots_supplied}
\alias{arg_dots_supplied}
\alias{arg_dots_not_supplied}
\title{Check Supplied Dots Argument}
\usage{
arg_dots_supplied(..., .msg = NULL, .call)

arg_dots_not_supplied(..., .msg = NULL, .call)
}
\arguments{
\item{\dots}{the \code{...} argument passed from a calling function. The argument is not evaluated. See Examples.}

\item{.msg}{an optional alternative message to display if an error is thrown instead of the default message.}

\item{.call}{the execution environment of a currently running function, e.g. \code{.call = rlang::current_env()}. The corresponding function call is retrieved and mentioned in error messages as the source of the error. Passed to \code{\link[=err]{err()}}. Set to \code{NULL} to omit call information. The default is to search along the call stack for the first user-facing function in another package, if any.}
}
\value{
Returns \code{NULL} invisibly if an error is not thrown.
}
\description{
Checks whether an argument was supplied to \code{...}.
}
\details{
\code{arg_dots_supplied()} checks whether arguments were passed to the \code{...} (i.e., "dots") argument of a function. These arguments are not evaluated. \code{arg_dots_supplied()} throws an error if \code{\link[=...length]{...length()}} is 0. It can be useful for when a function must have additional arguments. For example, \code{\link[=arg_or]{arg_or()}} and \code{\link[=when_supplied]{when_supplied()}} use \code{\link[=arg_dots_supplied]{arg_dots_supplied()}}.

\code{arg_dots_not_supplied()} checks whether no arguments were passed to \code{...}, again without evaluating the arguments and using \code{...length()}. It can be useful when a function appears to allow further arguments (e.g., because it is a method of a generic), but when the author does not want the user to supply them.
}
\examples{
f <- function(...) {
  arg_dots_supplied(...)
}

try(f(1)) # No error: argument supplied
try(f())  # Error!
}
\seealso{
\code{\link[=arg_supplied]{arg_supplied()}}
}
