Learn R Programming

W4MRUtils (version 1.0.0)

optparse_flag: optparse_flag - define a command parameter as a trigger

Description

To be used with optparse_parameters. This function tells the provided parameter is a trigger (logical - TRUE/FALSE). When the trigger parameter is not provided in the command line, the value is FALSE. Otherwise, it is TRUE.

Usage

optparse_flag(help = "No documentation yet.", short = NULL, default = FALSE)

Value

a list to give to optparse_parameters to build the whole command line parsing tool.

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.

Author

L.Pavot

See Also

optparse_parameters()

Examples

Run this code

str(optparse_parameters(
  a_parameter = optparse_flag(),
  args = list("--a-parameter")
))

Run the code above in your browser using DataLab