add.help | R Documentation |
Convenience functions for adding help, skip, and version arguments to an ArgumentParser.
A help argument will print the help message when requested, a skip argument will indicate that the following arguments are for another program (and hence, will not be parsed by the parser), and a version argument will print the version of the running program.
## S4 method for signature 'essentials_ArgumentParser'
add.help(name.or.flags = c("-h", "--help"), action = "help",
help = default.help("help"), wrap = FALSE, ...)
## S4 method for signature 'essentials_ArgumentParser'
add.skip(name.or.flags = "--args", action = "skip",
help = default.help("skip"), wrap = FALSE, ...)
## S4 method for signature 'essentials_ArgumentParser'
add.version(name.or.flags = "--version", action = "exit",
help = default.help("version"), wrap = FALSE, exit, ...)
name.or.flags |
character vector. The name or flags of the argument. |
action |
character string. Indicates what to do when this argument is encountered. |
help |
character vector. A brief description of the formal argument. |
wrap |
logical. Should the usage message |
exit |
character vector. The text to be printed before terminating the program. |
... |
further arguments passed to |
Invisible NULL
.
Unlike Python's argparse, a version argument is a specific case of an exit argument, an argument which will print an exit message before the program is terminated. For example, on Unix, the RHOME argument for the ‘R’ executable is an exit argument, and its exit message is the R home directory.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.