diff options
author | isaacs <i@izs.me> | 2010-05-17 01:41:18 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2010-05-17 01:41:18 +0400 |
commit | bafb5aa9632d063d567cb9cefc8867ff11f00b3d (patch) | |
tree | 5fb4373658db64f7d80c46987428ec537b8472d4 /cli.js | |
parent | 6e9167360606a4186dfaaaa3e28fac83d40706e0 (diff) |
Don't be so noisy if no command is specified.
Diffstat (limited to 'cli.js')
-rwxr-xr-x | cli.js | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -41,16 +41,19 @@ if (key) conf[key] = true npm.argv = arglist for (var k in conf) npm.config.set(k, conf[k]) -if (!command) npm.commands.help([arglist.join(" ")]) -else npm.commands[command](arglist, function (er, ok) { +if (!command) { + // npm.commands.help([arglist.join(" ")]) + sys.error( "Usage:\n" + + " npm [flags] <command> [args]\n" + + "Check 'man npm' or 'man npm-help' for more information" + ) +} else npm.commands[command](arglist, function (er, ok) { if (er) { sys.error("") - log("Error: "+er.message, "!") - var s = er.stack.split("\n").slice(2) - s.forEach(function (s) { log(s, "!") }) + log(er, "!") sys.error("") log("try running: 'npm help "+command+"'", "failure") - log("or report this at <http://github.com/isaacs/npm/issues>", "failure") - log("or email <npm-@googlegroups.com>", "failure") + log("Report this *entire* log at <http://github.com/isaacs/npm/issues>", "failure") + log("or email it to <npm-@googlegroups.com>", "failure") } else log("ok") }) |