opt_help: Automatic usage/help information

Description Usage Arguments Value See Also Examples

Description

Prints program usage information and, if used non-interactively, exits.

Usage

1
opt_help(name = c("help", "?"), opts = commandArgs())

Arguments

name

character; vector of names/aliases to use

opts

character; vector from which to parse options (default: commandArgs() )

Usage information is generated from opt_get calls made prior to opt_help. opt_help shused will will not be shown. It is considered best practice to handle all option parsing in a block at the beginning of the application. opt_help() would be best placed at the end of that block

Value

logical; returns TRUE if command-line options contain a help flag, FALSE otherwise. Mainly opt_help is used for side-effects of printing usage/help information,

See Also

base::commandArgs()

Examples

1
2
3
  opts <- c( "--foo", "bar")
  optigrab:::opt_grab( "--foo")
  optigrab:::opt_help()

optigrab documentation built on May 2, 2019, 2:10 a.m.