[Rd] Rscript Bug Report (improper parsing of [args])

Trevor Davis trevor.l.davis at gmail.com
Fri Oct 20 20:09:16 CEST 2017


Hi,

A user of my `optparse` package discovered a bug in Rscript's parsing of
[args]. (https://github.com/trevorld/optparse/issues/24)

I've reproduced the bug on my machine including compiling and checking the
development version of R.  I couldn't find a mention of it in the Bug
Tracker or New Features.

Can be minimally reproduced on the UNIX command line with following
commands:

    bash$ touch test.R
    bash$ Rscript test.R -g 5

    WARNING: unknown gui '5', using X11

This is a bug because according to the documentation in ?Rscript besides
`-e` the only [options] Rscript should attempt to parse should

1) Come before the file i.e. `Rscript -g X11 test.R` and not `Rscript
test.R -g X11`
2) Begin with two dashes and not one i.e. `--` and not `-' i.e. `Rscript
--gui=X11 test.R` and not `Rscript -g X11 test.R` (although I'm not sure if
the command-line Rscript even needs to be supporting the gui option).

Thanks,

Trevor

	[[alternative HTML version deleted]]



More information about the R-devel mailing list