parse_args2: Parse command line options.

Description Usage Arguments Examples

View source: R/cli.R

Description

Parse command line options.

Usage

1

Arguments

...

Parameters pass to parse_args2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#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'))

ngstk documentation built on May 2, 2019, 9:19 a.m.