   exclude = null
   if programm.exclude
     exclude = new RegExp programm.exclude
-  
-  # get a list of all files (env in sub directories) 
+
+  # get a list of all files (env in sub directories)
   inspect = (dir, done) ->
     # exit if directory is excluded
     return done() if exclude?.test dir

    async.forEach files, (f, next) ->
      parseFile f, (err, r) ->
        if err?
          r = 
            err: err
            path: f
        else


# convert data to CSV format for easy import into Spreadsheets
csvify = (data) ->
  lines = "Path,Physical lines,Lines of source code,Total comment,Singleline,Multiline,Empty\n"

  lineize = (t) ->
    (if t.path then t.path else "Total") + "," + ([t.loc, t.sloc, t.cloc, t.scloc, t.mcloc, t.nloc].join ",") + "\n"

  if data.details
    for sf in data.details
      lines += lineize sf
  else
    lines += lineize data

  lines

print = (err, r, file=null) ->
  if programm.json
    return console.log JSON.stringify if err? then err: err else r

  if programm.csv
    return console.log if err? then err: err else csvify r

  unless file?
    console.log "\n---------- result ------------\n"
