which 289 B

1234567891011121314
  1. #!/usr/bin/env node
  2. var which = require("../")
  3. if (process.argv.length < 3) {
  4. console.error("Usage: which <thing>")
  5. process.exit(1)
  6. }
  7. which(process.argv[2], function (er, thing) {
  8. if (er) {
  9. console.error(er.message)
  10. process.exit(er.errno || 127)
  11. }
  12. console.log(thing)
  13. })