Learn R Programming

optigrab (version 0.9.2.1)

opt_help: Automatic usage/help information

Description

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

Usage

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

Run this code
# NOT RUN {
  opts <- c( "--foo", "bar")
  optigrab:::opt_grab( "--foo")
  optigrab:::opt_help()

# }

Run the code above in your browser using DataLab