Error when trying to not use a help flag
trevorld opened this issue · 0 comments
trevorld commented
Mentioned here trevorld/r-getopt#9
Code like this should work:
option_list_neg <- list( make_option(c("-h", "--mean"), default=0.0) )
parser <- OptionParser(usage = "\\%prog [options] file", option_list=option_list_neg, add_help_option=FALSE)
args <- parse_args(parser, args = c("-h", "-5.0"))
expect_equal(args, list(mean = -5.0))