     result = convert.toJSON result
   fs.writeFileSync output, result, 'utf-8'
 
-file.fileToFile = (input, output, converter = null) ->
+file.fileToFile = (input, output, options) ->
   inFormat = file.extensionOf input
   outFormat = file.extensionOf output
   unless inFormat

  unless outFormat
    console.warn "Could not detect extension of #{output}"
    return
  unless converter?
    converter = convert.getConverter inFormat, outFormat
    unless converter?

        switch arg
          when '-o', '--output'
            mode = 'output'
          when '--flat-fold'
            options.flatFold = true
          else
            filenames.push arg
  for filename in filenames
    file.fileToFile filename, output, options

file.main() if require.main == module
