     running: false
     currentTest: null
     graph: null
+    specs: specs
 
   httpServer = new http.Server
   runtime = websocket httpServer, {}

parse = (args) ->
  program = require 'commander'

  program
    .arguments('<test directory>')
    .action( (dir) -> program.directory = dir )

    handleFbpCommand state, runtime, mocha, specs, protocol, command, payload, context

  httpServer.listen options.port, (err) ->
    return callback err, state

exports.main = main = () ->

  options = parse process.argv

  setup options, (err, state) ->
    throw err if err
    console.log "fbp-spec-mocha started on ws://#{options.host}:#{options.port}"
    console.log "found #{state.specs.length} test suites"

main() if not module.parent

