From fdf95d39dd94fde18db35aae3c8372c3615b9bfd Mon Sep 17 00:00:00 2001 From: Kevin Crouse Date: Tue, 10 Oct 2023 08:46:41 -0400 Subject: [PATCH] adding doc to git --- R/utils.R | 4 ++-- man/precommit_docopt.Rd | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 man/precommit_docopt.Rd diff --git a/R/utils.R b/R/utils.R index e79428c22..d1040c06b 100644 --- a/R/utils.R +++ b/R/utils.R @@ -90,10 +90,10 @@ git_init <- function(path = ".") { #' are semantically equivalent in R, this can create problems #' when a single parameter is provided. Thus, this function #' wraps docopt to ensure that the args will always be -#' interpretted as a vector. +#' interpreted as a vector. #' #' @param doc `character` vector with command line specification -#' @param args `character` vector of commandline arguments. +#' @param args `character` vector of command line arguments. #' Defaults to `commandArgs(trailingOnly=TRUE)`. #' @param ... Additional parameters passed to `docopt` #' @family hook script helpers diff --git a/man/precommit_docopt.Rd b/man/precommit_docopt.Rd new file mode 100644 index 000000000..ac6eb8f04 --- /dev/null +++ b/man/precommit_docopt.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils.R +\name{precommit_docopt} +\alias{precommit_docopt} +\title{Provide a singular interface for hook calls to docopt} +\usage{ +precommit_docopt(doc, args = commandArgs(trailingOnly = TRUE), ...) +} +\arguments{ +\item{doc}{\code{character} vector with command line specification} + +\item{args}{\code{character} vector of command line arguments. +Defaults to \code{commandArgs(trailingOnly=TRUE)}.} + +\item{...}{Additional parameters passed to \code{docopt}} +} +\description{ +docopt provides different processing for a single string +than an array/vector. As \verb{"string"`` and }c("string")` +are semantically equivalent in R, this can create problems +when a single parameter is provided. Thus, this function +wraps docopt to ensure that the args will always be +interpreted as a vector. +} +\seealso{ +Other hook script helpers: +\code{\link{diff_requires_run_roxygenize}()}, +\code{\link{dirs_R.cache}()}, +\code{\link{may_require_permanent_cache}()}, +\code{\link{robust_purl}()}, +\code{\link{roxygen_assert_additional_dependencies}()}, +\code{\link{roxygenize_with_cache}()} +} +\concept{hook script helpers} +\keyword{internal}