code: function parse(args, optsSpec) {
    if (args[0] == "?") return printHelp()
  
    optsSpec = optsSpec || {}
    optsSpec.port    = [ "p", Number  ]
    optsSpec.verbose = [ "v", Boolean ]
    optsSpec.help    = [ "h", Boolean ]
  
    var longOpts   = {}
    var shortOpts  = {}
    var defValues  = {}
  
    for (var name in optsSpec) {
      var fixedName = name.replace(/_/g, "-")
  
      var opt = optsSpec[name]
  
      var shortName = opt[0]
      var type      = opt[1]
      var defValue  = opt[2]
  
      if (type == Boolean) defValue = false
  
      shortOpts[shortName] = "--" + fixedName
      longOpts[fixedName]  = type
  
      if (defValue != null) {
        defValues[fixedName] = defValue
      }
    }
  
    var parsed = nopt(longOpts, shortOpts, args, 0)
  
    if (parsed.help) return printHelp()
  
    var opts
  
    args = parsed.argv.remain
    opts = _.pick(parsed, _.keys(longOpts))
    opts = _.defaults(opts, defValues)
  
    if (opts.port == null) {
      if (process.env.PORT != null) opts.port = process.env.PORT
    }
  
    if (opts.port == null) {
      opts.port = ports.getPort(utils.COMMAND)
    }
  
    utils.verbose(opts.verbose)
  
    return {args:args, opts:opts}
  }
docs: ------------------------------------------------------------------------------