         res.send data
       .fail (err) -> res.send(500, err: err)
 
-    port = 3000
+    port = parseInt(web, 10) or 3000
     console.log "Starting web server on port #{port}...".green
     app.listen(port)

  .describe('o', 'Write data to JSON file. Usage: "-o data.json"')
  .alias('t', 'table')
  .describe('t', 'Output results as CLI table')

argv = optimist.argv



  console.log "Using books.yml with #{books.books.length} ISBNs".grey

  table = argv.t or argv.table
  if table
    output = require('./src/tableOutput')
    output retrieve(books.books)

