Here are 4 docopt docs, and an option-less call results in the same 4 outputs for all cases in the reference implementation... but in the R package one of the docs results in list() instead of NULL.
List of 2
$ --foo: list()
$ --bar: list()
- attr(*, "class")= chr [1:2] "docopt" "list"
Case 4:
doc <- "
prog
Usage:
prog [options] [(--foo=X --bar=X)]
Options:
--foo=X some description
--bar=X some other description
"
str(docopt::docopt(doc, "", strict = TRUE))
List of 2
$ --foo: NULL
$ --bar: NULL
- attr(*, "class")= chr [1:2] "docopt" "list"
Cases 1, 2, and 4 give --foo and --bar as NULL.
Case 3 give --foo and --bar as list().
The Python reference implementation gives null for all four cases.
Here are 4 docopt docs, and an option-less call results in the same 4 outputs for all cases in the reference implementation... but in the R package one of the docs results in
list()
instead ofNULL
.Case 1 :
Case 2:
Case 3:
Case 4:
Cases 1, 2, and 4 give
--foo
and--bar
asNULL
. Case 3 give--foo
and--bar
aslist()
. The Python reference implementation givesnull
for all four cases.