Learn R Programming

ngstk (version 0.2.3)

parse_args2: Parse command line options.

Description

Parse command line options.

Usage

parse_args2(...)

Arguments

...

Parameters pass to parse_args2

Examples

Run this code
# 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