     )
   )
 
-
 #argumentData = [{name:'argName1',default:'optionalArg'}, {name:'argName2',csv:true}, ...]
-exports.parseArgs = (casper, argumentData) ->
-  ARGS = []; missingRequired = []; posArg = -1; argCount = 0
+exports.parseArgs = (casper, argumentData, argumentString) ->
+  ARGS = []; posArg = -1; argCount = 0
+  missingRequired = []; missingIndex = -1
 
   for arg in argumentData # get the arguments from the command line
     if casper.cli.raw.has arg.name

      ARGS[argCount] = arg.default
    else # if no default value is given then it is a required argument
      missingRequired.push arg.name

    if arg.csv and ARGS[argCount]?
      ARGS[argCount] = ARGS[argCount].split(',')
    argCount++

  if missingRequired.length > 0 # if any required arguments were missing
    casper.echo "argErr: #{missingRequired} are required parameters."
    casper.exit 1
  ARGS # return

require = patchRequire(global.require)
utils = require('utils')
sys = require('system')

exports.createCasper = (casperOptions = {}) ->
  require('casper').create(
