as_argument: Transform arguments as a pairs of flag and values

Description Usage Arguments Examples

Description

Transform arguments as a pairs of flag and values

Usage

1
2
as_argument(flag = NA, arg = NA, expect = NA, spacer = " ",
  parrot = is.list(arg), mark = "-", mandatory = NA)

Arguments

flag

option parameter

arg

option arguments, provide empty string for no arguments

spacer

for parameters

expect

number of parameters to expect if given any (for required number of parameters use 'mandatory')

mandatory

number of mandatory parameters (for optional parameters use 'expect')

parrot

repeat flag for each list element ?

mark

flag marker

Examples

1
2
3
4
5
6
as_argument("merged", TRUE) #== "-merged"
as_argument("merged", FALSE) #== ""
as_argument("op", NA) #== ""
as_argument("op", "123")  #== "-op 123"
as_argument("op", c(1, 2, 3)) #== "-op 1 2 3"
as_argument("op", list(c(1, 2, 3), c(4, 5, 6)), parrot = TRUE) #== "-op 1 2 3 -op 4 5 6"

etiennebr/taco documentation built on May 16, 2019, 9:06 a.m.