#! /usr/local/bin/Rscript #options(echo = FALSE) library(methods) source("calendar.R") cargs <- commandArgs(TRUE) #print(cargs) nn = length(cargs) if(nn<1){ stop("\nUsage: getCourses year [options] where year is one of the directory names in the form yyyy-yy and options is any subset of showYale = T SEM = FALL (or SEM = SPRING) outfile = insert_file_name_here.pdf ") } aa = vector("list",length(cargs)) names(aa) = rep("",nn) tagged = grep("=",cargs) aa[-tagged] = cargs[-tagged] TT = matrix(unlist(strsplit(cargs[tagged],"=")),ncol=2,byrow=T) aa[tagged] = TT[,2] names(aa)[tagged] = TT[,1] print(aa) do.call("getCourses",aa)