The spec
vector has length 6*n
, where n
is the number of command line
arguments specified. The spec
has the same format as the spec
parameter in the getopt function of the getopt package, though we have
one additional entry specifying a defaut value. The six entries per
argument are the following:
- long flag name (a multi-character string)
- short flag name (a single character)
- Argument specification: 0=no arg, 1=required arg, 2=optional arg
- Data type ('logical', 'integer', 'double', 'complex', or 'character')
- A string describing the option
- The default value to be assigned to this parameter
See getopt in getopt.package for details. The following vector defines the default command line
args. The vector is appended to the user-supplied spec
vector in the
call to getopt.
basespec = c(
'mapper', 'm',0, "logical","Runs the mapper.",F,
'reducer', 'r',0, "logical","Runs the reducer, unless already running mapper.",F,
'mapcols', 'a',0, "logical","Prints column headers for mapper output.",F,
'reducecols', 'b',0, "logical","Prints column headers for reducer output.",F,
'infile' , 'i',1, "character","Specifies an input file, otherwise use stdin.",NA,
'outfile', 'o',1, "character","Specifies an output file, otherwise use stdout.",NA,
'skip', 's',1,"numeric","Number of lines of input to skip at the beginning.",0,
'chunksize', 'C',1,"numeric","Number of lines to read at once, a la scan.",-1,
'numlines', 'n',1,"numeric","Max num lines to read per mapper or reducer job.",0,
'sepr', 'e',1,"character","Separator character, as used by scan.",'\t',
'insep', 'f',1,"character","Separator character for input, defaults to sepr.",NA,
'outsep', 'g',1,"character","Separator character output, defaults to sepr.",NA,
'help', 'h',0,"logical","Get a help message.",F
)