The R and Rscript know --args . Compare the output:
R -e "TRUE" --args --silent R -e "TRUE" --silent
This works because of an early exit if --args detected. However, the --gui warning runs in a separate loop before that .
It means that
Rscript -e "commandArgs()" --args --gui
will work, but give a false warning, and
Rscript -e "commandArgs()" --gui
gives an error right away. It only looks like --gui and -g .
Like a quick and dirty hack, you can insert something like
if(!strcmp(*avv, "--args")) { break; }
at the beginning of the GUI validation loop . Until this changes in R, I suspect there is no choice but to avoid the -g switch or live with a warning (otherwise harmless).
krlmlr
source share