This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/errno/cli.js

23 lines
440 B
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
#!/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)
}