Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cli.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2010-05-17 01:41:18 +0400
committerisaacs <i@izs.me>2010-05-17 01:41:18 +0400
commitbafb5aa9632d063d567cb9cefc8867ff11f00b3d (patch)
tree5fb4373658db64f7d80c46987428ec537b8472d4 /cli.js
parent6e9167360606a4186dfaaaa3e28fac83d40706e0 (diff)
Don't be so noisy if no command is specified.
Diffstat (limited to 'cli.js')
-rwxr-xr-xcli.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/cli.js b/cli.js
index a6d444b66..300aa2209 100755
--- a/cli.js
+++ b/cli.js
@@ -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")
})