parse_command_line: Parse the command line

View source: R/parse_command_line.R

parse_command_lineR Documentation

Parse the command line

Description

Parse the command line

Usage

parse_command_line(args, default_help = TRUE)

Arguments

args

command line arguments

default_help

use built-in help generation (set to FALSE to provide eg subcmd-specific help)

Value

a list of parsed data

Examples

args <- commandArgs(trailingOnly = TRUE)
mydata <- parse_command_line(args)
# After parse_command_line(), access values as mydata$<var_name>, eg
# writeLines (paste("command:",mydata$command))
# writeLines (paste("subcommand:",mydata$subcmd))
# writeLines (paste("infile:", mydata$infile))
# writeLines (paste("outfile:",mydata$outfile))

jperkel/cmdparseR documentation built on Oct. 11, 2024, 10:11 a.m.