docopt {docopt} | R Documentation |
Parse args
based on command-line interface described in doc
.
Description
docopt
creates your command-line interface based on its
description that you pass as doc
.
Such description can contain
–options, <positional-argument>, commands, which could be
[optional], (required), (mutually | exclusive) or repeated...
Usage
docopt(
doc,
args = commandArgs(TRUE),
name = NULL,
help = TRUE,
version = NULL,
strict = FALSE,
strip_names = !strict,
quoted_args = !strict
)
Arguments
doc |
|
args |
|
name |
Currently not used |
help |
|
version |
|
strict |
|
strip_names |
if |
quoted_args |
if |
Value
named list with all parsed options, arguments and commands.
References
Examples
"Usage: my_program.R [-hso FILE] [--quiet | --verbose] [INPUT ...]
-h --help show this
-s --sorted sorted output
-o FILE specify output file [default: ./test.txt]
--quiet print less text
--verbose print more text" -> doc
docopt(doc, "-s --quiet")