trevorld / r-argparse

command-line optional and positional argument parser
GNU General Public License v2.0
103 stars 11 forks source link

"Unclosed string" error for large number of args #10

Closed tpospisi closed 9 years ago

tpospisi commented 9 years ago

Whenever I pass in a large number of arguments I hit the following error "Error in rjson::fromJSON(output) : unclosed string". Here's a minimal example

parser <- ArgumentParser()
parser$add_argument("--lotsofstuff", type = "character", nargs = "+")
parser$parse_args(c("--lotsofstuff", rep("stuff", 100)))  # works
parser$parse_args(c("--lotsofstuff", rep("stuff", 1000))) # doesn't work
parser$parse_args(c("--lotsofstuff", rep("stuff", 898))) # first error
parser$parse_args(c("--lotsofstuff", rep("stuf", 1000))) # "stuf" vs "stuff"
trevorld commented 9 years ago

Thanks for the bug report! Should be fixed in the development version now.