addFlag: Add flag argument to parser.

Description Usage Arguments Value Methods (by class) Examples

Description

Add flag argument to parser.

Usage

1
2
3
4
5
addFlag(x, name, ...)

## S4 method for signature 'ArgParser,character'
addFlag(x, name, short = NULL,
  default = NULL, optional = TRUE, help = NULL)

Arguments

x

An ArgParser object.

name

Character vector of the flag name. Should be of length 1 and prefixed with "--".

...

Other arguments used in dispatched method.

short

Optional alias for the flag. Should be of length 1 and prefixed with "-".

default

Optional default value. If any, Should be of length 1.

optional

Optional logical vector of length 1. Is the flag optional?

help

Optional character vector shown in usage for the flag. If any, should be of length 1.

Value

An ArgParser with the flag definition added.

Methods (by class)

Examples

1
2
p <- ArgParser("a test parser")
p <- addFlag(p, "--flag", "-f")

everdark/ArgParser documentation built on May 16, 2019, 9:39 a.m.