Closed cboettig closed 9 years ago
Hi Carl,
Thanks, let me thank you for your work on rocker: it is great work and really useful for the R community.
Regarding your question:
docopt
returns all specified -r
as a list. However you have found a glitch (aka bug) in docopt.R
: it currently only returns the last specified value. I will fix this issue this week and put a new version on CRAN.strsplit
to convert it back to a character vector (Note that quoted arguments/options is a docopt.R
extension). quoted options are available on github, not yet on CRAN (next week :-) )Thanks for your report (and "Hi Dirk")!
Edwin
Hi Carl,
It should be fixed in the github repo: could you please check if you have any problems with it? The following example is running fine on my computer.
"
Usage:
install.r [-r repo]...
Options:
-r=repo Repo [default: my_url]
" -> doc
library(docopt)
docopt(doc, '-r repo1 -r repo2')
Best, (and a happy new year!) Edwin
Small addition: The following is slightly more sound and works too.
"
Usage:
install.r [-r repo...]
Options:
-r=repo Repo [default: my_url]
" -> doc
library(docopt)
docopt(doc, '-r repo1 -r repo2')
Hi Edwin,
Thanks for the help and the quick fix! I think I'll go with your last suggestion of multiple -r
, that seems both very tidy and easy. Happy new year,
Carl
You guys rock. Happy New Year from (a today very cold) Chicago too!
Hi Edwin,
First I just wanted to say thanks for this awesome implementation of docopt; it's both elegant and immensely useful. I've been using docopt with @eddelbuettel in some littler scripts and I cannot figure out how to handle the case of an argument that is vector valued; in this case, providing multiple repository URLs for the argument to
--repos
in thatinstall2.r
script Is there a straightforward way to do this in docopt that I'm missing?Thanks again. & Dirk says hi.
-- Carl