addOpt: Add positional argument to parser.

Description Usage Arguments Value Methods (by class) Examples

Description

Add positional argument to parser.

Usage

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

## S4 method for signature 'ArgParser,character'
addOpt(x, name, help = NULL, narg = 1L,
  nrequired = narg)

Arguments

x

An ArgParser object.

name

Character vector of the opt name. Should be of length 1.

...

Other arguments used in dispatched method.

help

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

narg

Optinal number of arguments to be consumed.

nrequired

Optional number of arguments required to be consumed.

Value

An ArgParser with the opt definition added.

Methods (by class)

Examples

1
2
p <- ArgParser("a test parser")
p <- addOpt(p, "filename")

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