       switch @options.mode
         when @Mode.REL then 'release'
         when @Mode.DEV then 'dev'
-        else
+        else console.error 'Invalid mode'
 
     root = path.resolve __dirname, '../build', dir
 

#! /usr/bin/env coffee

express = require 'express'
{argv}  = require 'optimist'
path    = require 'path'

class DoppioServer
  constructor: ->


  set_options: (args) ->
    @options =
      verbosity: argv.verbosity
      mode: @Mode.REL
      logdir: './logs'

    if argv.dev then @options.mode = @Mode.DEV
    if argv.release then @options.mode = @Mode.REL

    @p3 "Input options: \n#{(key + ': ' + val for key, val of @options).join '\n'}"

  modestring: (mode) ->
    switch mode
      when @Mode.DEV then 'development'
      when @Mode.REL then 'release'
      else 'Invalid mode'

  p1: (m) -> @pn 1, m
  p2: (m) -> @pn 2, m
