     v = argv.shift()
     exports.argv[arg] = v
     n = arg[2..].toUpperCase().replace(/-/g, '_')
-    if defaults[n]?
-      exports[n] ?= common.matchType(defaults[n], v)
-      # Save as environmnet variables to pass on to any child processes
-      process.env["GENIEACS_#{n}"] = v
+    setConfig(n, v)
   else
     exports.argv.push(arg)
 

# Environment variable
for k, v of process.env
  k = k[9..] # remove "GENIEACS_" prefix
  if defaults[k]?
    exports[k] ?= common.matchType(defaults[k], v)


# Find config dir

  TASK_PARAMETERS_BATCH_SIZE : 32
}

exports.LIBXMLJS_OPTIONS = {}


setConfig = (name, value) ->
  return true if exports[name]?

  _value = null

  if defaults[name]?
    _value = common.matchType(defaults[name], value)
  else if common.startsWith(name, 'XML_PARSE_')
    n = name[10..].toLowerCase() # libxmljs' options are lower case
    _value = common.matchType(true, value)
    exports.LIBXMLJS_OPTIONS[n] = _value

  if _value?
    exports[name] = _value
    # Save as environmnet variable to pass on to any child processes
    process.env["GENIEACS_#{name}"] = _value

  return _value?


# Command line arguments
exports.argv = []
