     else
       files
 
-  (path.join p, r.path for r in res)
+  (r.path for r in res)
 
 options = {}
 fmtOpts = []


return programm.help() if programm.args.length < 1

result = files: []

groupByExt = (data) ->
  map = {}
  for f in data.files

    d.summary = helpers.summarize d.files.map (x) -> x.stats
  map

readSingleFile = (f, done) -> parseFile f, (err, res) ->
  done err, [res]

readDir = (dir, done) ->
  processFile = (f, next) -> parseFile (path.join dir, f), next

  readdirp { root: dir, fileFilter: exts }, (err, res) ->
    return done(err) if err
    async.map (filterFiles res.files), processFile, done

readSource = (p, done) ->
  fs.lstat p, (err, stats) ->
    if err
      console.error "Error: invalid path argument #{p}"
      return done(err)
    if stats.isDirectory() then return readDir p, done
    else if stats.isFile() then return readSingleFile p, done

async.map programm.args, readSource, (err, parsed) ->
  return console.error "Error: #{err}" if err

  result = files: []

  parsed.forEach (files) ->
    files.forEach (f) ->
      if f.badFile then result.brokenFiles++
      result.files.push f

  result.summary = helpers.summarize result.files.map (x) -> x.stats
  result.byExt = groupByExt result
  print result, options, fmtOpts
