OptionParser {optparse} | R Documentation |
This function is used to create an instance of the class OptionParser
which when combined
with its parse_args
method
is very useful for parsing options from the command line.
OptionParser(usage = "usage: %prog [options]", option_list = list(), add_help_option = TRUE, prog = NULL)
usage |
The program usage message that will printed out if parse_args finds a help option,
%prog is substituted with the value of the prog argument.
|
option_list |
A list of of OptionParserOption instances that will define how parse_args reacts to command line options.
OptionParserOption instances are usually created by make_option and can also be added to an existing
OptionParser instance via the add_option function.
|
add_help_option |
Whether a standard help option should be automatically added to the OptionParser instance.
|
prog |
Program name to be substituted for %prog in the usage message, the default is to use
the actual Rscript file name if called by an Rscript file and otherwise keep %prog .
|
An istance of the OptionParser
class.
Trevor Davis.
The documentation for Python's optparse library, which this package is based on, is Copyright 1990-2009, Python Software Foundation.
Python's optparse
library, which this package is based on,
is described here: http://docs.python.org/library/optparse.html
parse_args
make_option
add_option
OptionParser