diff --git a/bin/cli.js b/bin/cli.js index 033bf36..3670344 100644 --- a/bin/cli.js +++ b/bin/cli.js @@ -7,6 +7,7 @@ var fs = require('fs'); if (!fsname || '--help' === fs || '-h' === fs) { console.error('Usage: hexdump.js '); + process.exit(2); return; } @@ -14,6 +15,7 @@ try { fs.statSync(fsname); } catch(e) { console.error(e.message); + process.exit(3); return; } diff --git a/package.json b/package.json index c47ca93..628c2aa 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Like hexdump on *nix, but in JavaScript.", "main": "hexdump.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "node bin/cli.js hexdump.js" }, "repository": { "type": "git",