#!/usr/bin/env node

var argv = require('minimist')(process.argv.slice(2))

if (argv.help) {
  return console.log([
    '',
    'Usage: kinesalite [--port <port>] [--path <path>] [--ssl] [options]',
    '',
    'A mock Kinesis http server, optionally backed by LevelDB',
    '',
    'Options:',
    '--help                 Display this help message and exit',
    '--port <port>          The port to listen on (default: 4567)',
    '--path <path>          The path to use for the LevelDB store (in-memory by default)',
    '--ssl                  Enable SSL for the web server (default: false)',
    '--createStreamMs <ms>  Amount of time streams stay in CREATING state (default: 500)',
    '--deleteStreamMs <ms>  Amount of time streams stay in DELETING state (default: 500)',
    '',
    'Report bugs at github.com/mhart/kinesalite/issues',
  ].join('\n'))
}

require('./index.js')(argv).listen(argv.port || 4567)

@@ -855,16 +855,45 @@
 n'))%0A%7D%0A%0A
+var port = argv.port %7C%7C 4567%0A
 require(
@@ -919,27 +919,76 @@
 .listen(
-argv.port %7C%7C 4567
+port, function () %7B%0A  console.log('Listening on port: %25s', port)%0A%7D
 )%0A

Write to stdout when the http server is listening