cmd_list_to_flags: Convert flag list to vector of command flags

Description Usage Arguments Value Examples

View source: R/cmd_args.R

Description

Convert flag list to vector of command flags

Usage

1
cmd_list_to_flags(flagList, prefix = "-", sep = ",")

Arguments

flagList

output from cmd_list_interp(). A named list where names correspond to flags and members correspond to the value for the flag.

prefix

flag prefix, usually "-" or "–".

sep

separator to use if flag has a vector of values (default: NULL).

Value

character vector of parsed commandline flags followed by their values

Examples

1
2
3
4
theFunction <- function(...){cmd_args_all()}
theArgs <- theFunction(arg1 = "value", arg2 = TRUE)
flagList <- cmd_list_interp(theArgs)
flags <- cmd_list_to_flags(flagList)

snystrom/dotargs documentation built on Oct. 18, 2020, 8:39 a.m.