diff options
author | isaacs <i@izs.me> | 2011-03-25 04:22:16 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-03-25 04:27:32 +0300 |
commit | 2d7027d05f99c37f3b88cc9cf1903b51be7c5836 (patch) | |
tree | 6530dbedd59d0f38245214f5a20602e919d925ea /bin | |
parent | 85fbe183a5fe99e7d9c64bec2002dd27633639fb (diff) |
Use optparse instead of parse-args.js
Also, move default-config.js and the optparse hashes into
config-defs.js
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/npm.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/npm.js b/bin/npm.js index d026dfad7..71467a2b6 100755 --- a/bin/npm.js +++ b/bin/npm.js @@ -12,12 +12,14 @@ var fs = require("../lib/utils/graceful-fs") , rm = require("../lib/utils/rm-rf") , errorHandler = require("../lib/utils/error-handler") - , argv = process.argv.slice(2) - , parseArgs = require("../lib/utils/parse-args") + , configDefs = require("../lib/utils/config-defs") + , shorthands = configDefs.shorthands + , types = configDefs.types + , optparse = require("optparse") -log.verbose(argv, "cli") +log.verbose(process.argv, "cli") -var conf = parseArgs(argv) +var conf = optparse(types, shorthands) npm.argv = conf.argv.remain if (npm.deref(npm.argv[0])) npm.command = npm.argv.shift() else conf.usage = true |