diff options
author | isaacs <i@izs.me> | 2010-07-20 02:35:49 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2010-07-25 05:51:21 +0400 |
commit | ce03c09035dc958cbcc069cfb7f86aef38fc5ef0 (patch) | |
tree | 020a0b28cbecfda4440bd710b285d9fa8e1392e1 /cli.js | |
parent | e0fe8036ed058146de1e199d83c00c75440f2f66 (diff) |
If printing the version, show "ok" rather than "not ok"
Diffstat (limited to 'cli.js')
-rwxr-xr-x | cli.js | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -55,17 +55,19 @@ process.on("exit", function () { if (!itWorked) log("not ok") }) var itWorked = false -if (!command) { if (!printVersion) { - // npm.commands.help([arglist.join(" ")]) - if (arglist.length) log(arglist, "unknown command") - sys.error( "What do you want me to do?\n\n" - + "Usage:\n" - + " npm [flags] <command> [args]\n" - + "Check 'man npm' or 'man npm-help' for more information\n\n" - + "This is supposed to happen. " - ) - process.exit(1) -}} else npm.commands[command](arglist, errorHandler) +if (!command) { + if (!printVersion) { + // npm.commands.help([arglist.join(" ")]) + if (arglist.length) log(arglist, "unknown command") + sys.error( "What do you want me to do?\n\n" + + "Usage:\n" + + " npm [flags] <command> [args]\n" + + "Check 'man npm' or 'man npm-help' for more information\n\n" + + "This is supposed to happen. " + ) + process.exit(1) + } else itWorked = true +} else npm.commands[command](arglist, errorHandler) function errorHandler (er) { if (!er) { |