     @_validateOptions(@program)
     @_process(@program)
 
+  @_die: ->
+    log.error.apply(null, arguments)
+    process.exit(1)
+
   @_validateOptions: (options) ->
     errors = []
     errors.push('Missing required option: type') unless options.type

      process.stdin.setEncoding('utf8')
      process.stdin

    # TODO: error handling
    transformStream = _(inputStream.pipe(JSONStream.parse(jsonPath)))
    .batch(options.batch)
    .pipe(transform (chunk, cb) ->
      log.info 'chunk: %j', chunk, {}

    # so that when we pull the value after that we know that all chunks have been processed
    # and we can display a final message
    _(transformStream).reduce null, -> ''
    .stopOnError (e) => @_die 'Something went wrong while transforming chunks', e
    .pull (err, x) ->
      if err then log.error err
      else log.info service.summaryReport(options.from)
