Description Usage Arguments Details Value Assumptions See Also Examples
Return the verb for the application. The verb is the first argument that is not part of an option.
1 | opt_get_verb(opts = commandArgs())
|
opts |
character; Vector from which to parse options
(default: |
Some applications such as git support command verbs, e.g. push
,
fetch
, etc. These style arguments can be retrieved by opt_get_verb
.
opt_get_verb
look for the first unaccounted for options (after
--args
). The number of options needed by each flags is determined by
and saved by calls to opt_get()
. See the details to see how
n
is automatically determined. When not explicitly defined the number
of options needed by each flag is 1. Becasue of this, it convention to call
opt_get_verb
after all opt_get
calls. For most simple
applications, it likely doesn't matter.
character of length 1; the verb found from the command-line.
NA
if a verb cannot be identified.
opt_get_verb
assumes any flags occurring before the verb have
exactly 1 value. A command line such as "> myscript –verbose verb" will be
misparsed; the code will assume that "verb" is the value of the
flag "–verbose"
opt_get()
base::commandArgs()
1 2 | opt_get_verb() # commandArgs()
|
[1] "/usr/lib/R/bin/exec/R"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.