You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
440 B
23 lines
440 B
4 weeks ago
|
#!/usr/bin/env node
|
||
|
|
||
|
var errno = require('./')
|
||
|
, arg = process.argv[2]
|
||
|
, data, code
|
||
|
|
||
|
if (arg === undefined) {
|
||
|
console.log(JSON.stringify(errno.code, null, 2))
|
||
|
process.exit(0)
|
||
|
}
|
||
|
|
||
|
if ((code = +arg) == arg)
|
||
|
data = errno.errno[code]
|
||
|
else
|
||
|
data = errno.code[arg] || errno.code[arg.toUpperCase()]
|
||
|
|
||
|
if (data)
|
||
|
console.log(JSON.stringify(data, null, 2))
|
||
|
else {
|
||
|
console.error('No such errno/code: "' + arg + '"')
|
||
|
process.exit(1)
|
||
|
}
|