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-08-24 11:40:38 +0400
committerisaacs <i@izs.me>2010-08-24 11:40:38 +0400
commitb815f1763e8ff349a126eea2018c4fd19cd304a7 (patch)
tree290afa6ca8911d34dfdd22f8eb3dbca0e777dbc5 /cli.js
parent81fe31137d57d637d7afbb772671ac5e9106263f (diff)
make sure that falsey args get set right
Diffstat (limited to 'cli.js')
-rwxr-xr-xcli.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/cli.js b/cli.js
index 7b80cf551..1fcca7417 100755
--- a/cli.js
+++ b/cli.js
@@ -39,6 +39,9 @@ while (arg = argv.shift()) {
if (key === "help") conf[key] = true, key = null
flagsDone = (key === "")
} else if (key) {
+ if (arg === "false" || arg === "null") arg = JSON.parse(arg)
+ else if ( arg === "undefined" ) arg = undefined
+ else if (!isNaN(arg)) arg = +arg
conf[key] = arg
key = null
} else arglist.push(arg)