The R Project SVN R

Rev

Rev 74643 | Rev 81170 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 74643 Rev 77228
Line 22... Line 22...
22
#! /path/to/Rscript --vanilla
22
#! /path/to/Rscript --vanilla
23
commandArgs(TRUE)
23
commandArgs(TRUE)
24
q(status=7)
24
q(status=7)
25
 
25
 
26
This invokes R with a command line like
26
This invokes R with a command line like
27
R --slave --no-restore --vanilla --file=foo [script_args]
27
R --no-echo --no-restore --vanilla --file=foo [script_args]
28
 
28
 
29
*/
29
*/
30
 
30
 
31
/* execv exists and can be used on Windows, but it returns immediately
31
/* execv exists and can be used on Windows, but it returns immediately
32
   and so the exit status is lost.  HAVE_EXECV is defined under Windows.
32
   and so the exit status is lost.  HAVE_EXECV is defined under Windows.
Line 97... Line 97...
97
    fprintf(stderr, "  --version           Print version and exit\n");
97
    fprintf(stderr, "  --version           Print version and exit\n");
98
    fprintf(stderr, "  --verbose           Print information on progress\n");
98
    fprintf(stderr, "  --verbose           Print information on progress\n");
99
    fprintf(stderr, "  --default-packages=list\n");
99
    fprintf(stderr, "  --default-packages=list\n");
100
    fprintf(stderr, "                      Where 'list' is a comma-separated set\n");
100
    fprintf(stderr, "                      Where 'list' is a comma-separated set\n");
101
    fprintf(stderr, "                        of package names, or 'NULL'\n");
101
    fprintf(stderr, "                        of package names, or 'NULL'\n");
102
    fprintf(stderr, "or options to R, in addition to --slave --no-restore, such as\n");
102
    fprintf(stderr, "or options to R, in addition to --no-echo --no-restore, such as\n");
103
    fprintf(stderr, "  --save              Do save workspace at the end of the session\n");
103
    fprintf(stderr, "  --save              Do save workspace at the end of the session\n");
104
    fprintf(stderr, "  --no-environ        Don't read the site and user environment files\n");
104
    fprintf(stderr, "  --no-environ        Don't read the site and user environment files\n");
105
    fprintf(stderr, "  --no-site-file      Don't read the site-wide Rprofile\n");
105
    fprintf(stderr, "  --no-site-file      Don't read the site-wide Rprofile\n");
106
    fprintf(stderr, "  --no-init-file      Don't read the user R profile\n");
106
    fprintf(stderr, "  --no-init-file      Don't read the user R profile\n");
107
    fprintf(stderr, "  --restore           Do restore previously saved objects at startup\n");
107
    fprintf(stderr, "  --restore           Do restore previously saved objects at startup\n");
Line 217... Line 217...
217
	exit(1);
217
	exit(1);
218
    }
218
    }
219
    snprintf(cmd, PATH_MAX+1, "%s/bin/R", p);
219
    snprintf(cmd, PATH_MAX+1, "%s/bin/R", p);
220
#endif
220
#endif
221
    av[ac++] = cmd;
221
    av[ac++] = cmd;
222
    av[ac++] = "--slave";
222
    av[ac++] = "--no-echo";
223
    av[ac++] = "--no-restore";
223
    av[ac++] = "--no-restore";
224
 
224
 
225
    if(argc == 2) {
225
    if(argc == 2) {
226
	if(strcmp(argv[1], "--help") == 0) {
226
	if(strcmp(argv[1], "--help") == 0) {
227
	    usage();
227
	    usage();