# NOT RUN {
#example from vignette using positional arguments
option_list2 <- list(
make_option(c('-n', '--add-numbers'), action='store_true', default=FALSE,
help='Print line number at the beginning of each line [default]')
)
parser <- opt_parser(usage = '%prog [options] file', option_list=option_list2)
parse_args(parser, args = c('--add-numbers', 'example.txt'), positional_arguments = TRUE)
parse_args(parser, args = c('--add-numbers', 'example.txt'), positional_arguments = TRUE,
convert_hyphens_to_underscores = TRUE)
parse_args2(parser, args = c('--add-numbers', 'example.txt'))
# }
Run the code above in your browser using DataLab