 
   numFilesWritten = 0
 
-  logSummary = ->
-    message = []
+  printReport = ->
+    report = reporter
+      numSelectors: numSelectors
+      numFiles: numFiles
 
-    message.push "Input file contained #{formatNumber(numSelectors)} #{pluralize('selector', numSelectors)}."
-
-    if numFiles > 1
-      message.push "#{formatNumber(numFiles)} #{pluralize('file', numFiles)} created."
-    else
-      message.push 'No changes made.'
-
-    console.log  message.join(' ').green.bold
+    console.log report.green.bold
 
 
-  if numFiles > 1
+  if numFiles <= 1
+    printReport()
+  else
     for fileData, index in result.data
-      newFilename = "#{path.join(dirname, filename)}-blessed#{index + 1}#{extension}"
+      if index is 0
+        importStatements = importer
+          numFiles: result.data.length
+          output: output
+          suffix: suffix
 
-      fs.writeFile newFilename, fileData, (err) ->
-        throw err if err
-        console.log "Created #{newFilename}".yellow
-        numFilesWritten++
-        logSummary() if numFilesWritten is numFiles
-  else
-    logSummary()
+        fileData = """
+          #{importStatements}\n
+          #{fileData}
+        """
+
+        indexedSuffix = ""
+      else
+        indexedSuffix = "-#{suffix}-#{index}"
+
+      newFilename = "#{path.join(dirname, filename)}#{indexedSuffix}#{extension}"
+
+      do (newFilename) ->
+        fs.writeFile newFilename, "#{fileData}\n", (err) ->
+          throw err if err
+          numFilesWritten++
+          printReport() if numFilesWritten is numFiles


# If output was not provided, use the input parameter
#
output = output or input

# Exit if output was not provided and the input is to be read from stdin.
#

if output is input and not program.force
  console.log 'blessc: use --force or -f to modify the input file'.red
  process.exit 1


# Set the suffix for imported files.
#
suffix = program.suffix

# Use a default suffix is one isn't provided.
#
suffix ?= "blessed"


# For now, assume that the input is not stdin.
