 style =
   header: (str) -> '\x1b[1;4m' + str + '\x1b[0m'
   int: (str) -> '\x1b[34m' + str + '\x1b[0m'
+  tag: (str) -> '\x1b[32m' + str + '\x1b[0m'
   error: (str) -> '\x1b[31m' + str + '\x1b[0m'
   warning: (str) -> '\x1b[33m' + str + '\x1b[0m'
   over: (str) -> '\x1b[36m' + str + '\x1b[0m'

\n
\nDocumentation can be found at https://github.com/davedelong/starfruit/wiki'

SHELL_HELP = '\x1b[1mPilot [0.0.1]\x1b[0m
\nCopyright (c) 2014 Kan Kung-Yip.
\n
\nCommands:
\n  add <cpus>                add a server process, each process uses a cpu
\n                            core, default start 1 process
\n  clear                     clear screen
\n  help                      commands help infomation
\n  list                      list all server processes
\n  remove <pid>              shutdown a server process
\n  quit                      quit pilot shell and shutdown all server
\n                            processes
\n
\n'

# Store all workers
workers = { }

# Show help infomations.
help = (info) -> process.stdout.write info

# Start a server process
start = (env) ->
  worker = cluster.fork "NODE_ENV": env
  pid = worker.process.pid
  workers[pid] =
    date: new Date()
    process: worker
  return pid

# Boot servers cluster
boot = (env, argv) ->

  # boot master cluster
  return unless cluster.isMaster
  console.log 'Node environment: %s', style.header env.toUpperCase()
  basedir = process.cwd()

  # getting argvs
  cpus = 1
  dynamic = 'lib'

\n  Options:
\n    -c, -n, --cpus <cpus>     start server proess, each process uses a cpu
\n                              core, default start 1 process
\n    -s, --source <dir>        coffeescript sources path, default path is src
\n    -o, --out <dir>           coffeescript output path, default path is lib
\n    -d, --dynamic <dir>       dynamic contents path, default path is lib
\n    -l, --language <lang>     programming language:
\n                                - javascript
\n                                - coffeescript
\n                              default language is coffeescript
\n
\n  Commands:
\n    add [<cpus>]              add a server process, each process uses a cpu
\n                              core, default add 1 process
\n    clear                     clear screen
\n    error [[-]<id>]           list all internal errors, check error
\n                              information by error id or delete error by
\n                              error id
\n    help                      commands help infomation
\n    list                      list all server processes
\n    remove <pid>              shutdown a server process by process id
\n    quit                      quit pilot shell and shutdown all server
\n                              processes
\n
