library(R.devices)

args <- commandArgs(trailingOnly = TRUE)
engine <- args[1]

g <- capturePlot({plot(1:10)})
system <- attr(g, "system")
tags <- sprintf("%s=%s", names(system), system)
pathname <- sprintf("inst/exdata/capturePlot,engine=%s,%s.rds",
                    engine, paste(tags, collapse=","))
cat(sprintf("generating %s ...\n", pathname))
saveRDS(g, file=pathname)
