cli_arg: Extracting Command Line Arguments

Description Usage Arguments

View source: R/utils.R

Description

Extracting Command Line Arguments

Usage

1
2
3
cli_arg(name, default = NULL, alt = NA, required = FALSE,
  trailing.only = TRUE, as.is = TRUE, args = commandArgs(trailing.only),
  with.details = FALSE, error = TRUE)

Arguments

name

parameter name, e.g., '-f'

default

default value to return if parameter is missing

alt

alternative parameter name, e.g. long form code'–file'

required

logical that indicates if the parameter is required.

trailing.only

logical that indicates if the parameter should be looked in the trailing arguments only, or in the arguments meant for R or Rscript.

as.is

logical that indicates if the name should be looked up as is in the command line argument or with a double/single dash prefix.

args

vector of command line argument to parse

with.details

logical that indicates if details about the argument match should be returned.

error

logical that indicates if an error should be raised when the command line arguments do not meet the constrains, e.g., required.


renozao/CLIR documentation built on May 27, 2019, 5:52 a.m.