Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
440 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | #!/usr/bin/env node
|
---|
| 2 |
|
---|
| 3 | var errno = require('./')
|
---|
| 4 | , arg = process.argv[2]
|
---|
| 5 | , data, code
|
---|
| 6 |
|
---|
| 7 | if (arg === undefined) {
|
---|
| 8 | console.log(JSON.stringify(errno.code, null, 2))
|
---|
| 9 | process.exit(0)
|
---|
| 10 | }
|
---|
| 11 |
|
---|
| 12 | if ((code = +arg) == arg)
|
---|
| 13 | data = errno.errno[code]
|
---|
| 14 | else
|
---|
| 15 | data = errno.code[arg] || errno.code[arg.toUpperCase()]
|
---|
| 16 |
|
---|
| 17 | if (data)
|
---|
| 18 | console.log(JSON.stringify(data, null, 2))
|
---|
| 19 | else {
|
---|
| 20 | console.error('No such errno/code: "' + arg + '"')
|
---|
| 21 | process.exit(1)
|
---|
| 22 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.