#' Parsing command
#'
#' @description
#' Function parses command given by user
#' @export
parse_command = function() {
option_config =
optparse::make_option(c("-c", "--config",
type = "character",
default = NULL,
help = "YAML config filename"))
opt_parser =
optparse::OptionParser(option_list = list(option_config))
list(
options = optparse::parse_args(opt_parser),
parser = opt_parser)
}
#' Process command
#'
#' @description
#' Function processes terminal command given by user.
#' @export
process_command = function(.command) {
if(is.null(.command$options$config)) {
optparse::print_help(.command$parser)
cli::cli_alert_danger("Config file must be supplied.")
stop()
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.