 \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    error [[-]<id>] [+<max>]  list all internal errors, check error
 \n                              information by error id or delete error by
 \n                              error id
+\n                              +<max> to set the max number of error log,
+\n                              default max number is 20
 \n    help                      commands help infomation
 \n    list                      list all server processes
 \n    remove <pid>              shutdown a server process by process id

# Start a server process
start = (env) ->
  worker = cluster.fork "NODE_ENV": env
  worker.on 'message', (err) ->
    errors.index++
    errors[errors.index] = err
  pid = worker.process.pid
  date = new Date()
  year = date.getFullYear()


# Dispaly error infomation
error = (ids) ->
  if ids.length > 0
    max = ids[0]
    # max number of error log
    if max.indexOf('+') is 0
      max = parseInt max.substr 1
      max = 20 if isNaN max
      # delete overflow
      length = (index for index of errors).length - 1
      for key of errors
        if (key isnt 'index') and (length > max)
          delete errors[key]
          length--
      MAX_ERRS = max
      return console.log 'Record up to %s errors\n', style.int max
    # select error by id
    for id in ids
      fixed = false
      if id.indexOf('-') is 0
