diff options
author | isaacs <i@izs.me> | 2010-04-27 03:42:51 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2010-04-27 03:42:51 +0400 |
commit | f2ef34d846d15717d22f98434d1932a3d60fdaf5 (patch) | |
tree | 1cffc9277b71aa7c536536e8d491dfabc24a12b9 /lib | |
parent | 5eb45fc360c10d0523028ac83a63356dce428a45 (diff) |
show command not found message for unknown commands
Diffstat (limited to 'lib')
-rw-r--r-- | lib/help.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/help.js b/lib/help.js index 77d1d5390..3adb54302 100644 --- a/lib/help.js +++ b/lib/help.js @@ -13,7 +13,10 @@ module.exports = help function help (args, conf, cb) { var command = args.shift() fs.stat(path.join(__dirname, "../man/"+command+".1"), function (e, o) { - if (e) command = "help" + if (e) { + sys.error("command not found: "+command) + command = "help" + } // TODO: Figure out how to do this so that the user can still page it exec("man", [path.join(__dirname, "../man/"+command+".1")], function () { process.stdout.flush() |