optparse_list {W4MRUtils}R Documentation

optparse_list - define a command parameter as a list of objects

Description

To be used with optparse_parameters. This function tells the provided parameter is to be parsed as a list of objects. The of parameter tells what type are elements of the list. Each element must be separated by a separator. This separator must be the value given in the sep parameter

Usage

optparse_list(
  help = "No documentation yet.",
  short = NULL,
  default = "",
  of = "character",
  sep = ",",
  truevalues = c("TRUE", "true", "1", "t", "T")
)

Arguments

help
  • The help string to display when –help is triggered

short
  • The shortcut fir this parameter. For example for a –output param, we could use optparse_flag(short = "-o", ...) to set the "-o" shortcut.

default
  • The default value this parameter will hold.

of
  • This type of elements of this list

sep
  • This character to split on, to get the list

truevalues
  • A character vector of different string values to translate it as TRUE value.

Author(s)

L.Pavot

See Also

optparse_parameters()

Examples


str(optparse_parameters(
  a_parameter = optparse_list(of="numeric"),
  b_parameter = optparse_list(of="integer"),
  c_parameter = optparse_list(of="logical"),
  args = list(
    "--a-parameter", "42.7,72.5",
    "--b-parameter", "42.7,72.5",
    "--c-parameter", "TRUE,FALSE,FALSE,TRUE"
  )
))


[Package W4MRUtils version 1.0.0 Index]