R/calibrar-auxiliar.R
dot-get_command_argument.Rd
Get an specific argument from the command line
.get_command_argument(
x,
argument,
prefix = "--",
default = FALSE,
verbose = FALSE
)
The command line arguments, from x = commandArgs()
The name of the argument.
The prefix to any argument of interest, the default is "--"
Default value to return is argument is missing, default to FALSE.
Boolean, if TRUE, shows a warning when the parameter is not found.
The value of the argument, assumed to be followed after '=' or, TRUE if nothing but the argument was found. If the argument is not found, FALSE is returned.
.get_command_argument(commandArgs(), "interactive")
#> [1] FALSE
.get_command_argument(commandArgs(), "RStudio")
#> [1] FALSE
.get_command_argument(commandArgs(), "RStudio", prefix="")
#> [1] FALSE
.get_command_argument(commandArgs(), "vanilla")
#> [1] FALSE
.get_command_argument("--control.file=baz.txt", "control.file")
#> [1] "baz.txt"