     if err
         process.exit(1)
     if program.test
-        winston.debug("Test mode -- now exiting")
-        process.exit(0)
-
+        winston.debug("Test mode -- waiting 5 seconds")
+        setTimeout ->
+            winston.debug("Test mode -- now exiting")
+            process.exit(0)
+        , 5000
+

uuid    = require('uuid')
winston = require('winston')
request = require('request')
program = require('commander')          # command line arguments -- https://github.com/visionmedia/commander.js/

init_gitconfig = require('./gitconfig').init_gitconfig


doing a lot of IO-based things is what Node.JS is good at.
###

program = require('commander')          # command line arguments -- https://github.com/visionmedia/commander.js/

program.usage('[?] [options]')
    .option('--tcp_port <n>', 'TCP server port to listen on (default: 0 = os assigned)', ((n)->parseInt(n)), 0)
    .option('--raw_port <n>', 'RAW server port to listen on (default: 0 = os assigned)', ((n)->parseInt(n)), 0)
    .option('--console_port <n>', 'port to find console server on (optional; uses port file if not given); if this is set we assume some other system is managing the console server and do not try to start it -- just assume it is listening on this port always', ((n)->parseInt(n)), 0)
    .option('--kucalc', "Running in the kucalc environment")
    .option('--test_firewall', 'Abort and exit w/ code 99 if internal GCE information is accessible')
    .option('--test', "Start up everything, then immediately exit.  Used as a test and to ensure coffeescript and typescript is compiled/cache")
    .parse(process.argv)

if program.kucalc and not program.test
    console.warn("ts-node is not enabled!")
else
    require('ts-node').register(project:"#{__dirname}/tsconfig.json", cacheDirectory:'/tmp')

path    = require('path')
async   = require('async')
