Skip to contents

Make a new scribeCommandArgs object

Usage

command_args(
  x = NULL,
  include = getOption("scribe.include", c("help", "version", NA_character_)),
  string = NULL,
  super = include
)

Arguments

x, string

Command line arguments; see base::commandArgs() for default. At least one parameter has to be NULL. When string is NULL, x is used, which defaults to commandArgs(trailingOnly = TRUE). Otherwise the value of x is converted to a character. If string is not NULL, scan() will be used to split the value into a character vector.

include

Special default arguments to included. See $initialize() in scribeCommandArgs for more details.

super

When TRUE the scribeCommandArgs object will be initialized with standard super arguments (e.g., ---help, ---version)

Value

A scribeCommandArgs object

See also

Examples

command_args()
#> Initial call:  
#> w Call $resolve() or $parse() to resolve arguments
#> Argument [--help] : FALSE
#> Argument [--version] : FALSE
command_args(c("-a", 1, "-b", 2))
#> Initial call:  -a 1 -b 2
#> w Call $resolve() or $parse() to resolve arguments
#> Argument [--help] : FALSE
#> Argument [--version] : FALSE
command_args(string = "-a 1 -b 2")
#> Initial call:  -a 1 -b 2
#> w Call $resolve() or $parse() to resolve arguments
#> Argument [--help] : FALSE
#> Argument [--version] : FALSE