Browse Source

updated command-line-args

master
Lloyd Brookes 11 years ago
parent
commit
7e9b67df57
  1. 6
      bin/ws.js
  2. 6
      package.json

6
bin/ws.js

@ -3,7 +3,7 @@
var dope = require("console-dope"), var dope = require("console-dope"),
connect = require("connect"), connect = require("connect"),
http = require("http"), http = require("http"),
parseArgv = require("command-line-args"),
cliArgs = require("command-line-args"),
w = require("wodge"), w = require("wodge"),
path = require("path"), path = require("path"),
loadConfig = require("config-master"), loadConfig = require("config-master"),
@ -37,14 +37,14 @@ var storedConfig = loadConfig(
/* override stored config with values parsed from command line */ /* override stored config with values parsed from command line */
try { try {
var argv = parseArgv([
var argv = cliArgs([
{ name: "port", alias: "p", type: Number, defaultOption: true, value: 8000 }, { name: "port", alias: "p", type: Number, defaultOption: true, value: 8000 },
{ name: "log-format", alias: "f", type: String }, { name: "log-format", alias: "f", type: String },
{ name: "help", alias: "h", type: Boolean }, { name: "help", alias: "h", type: Boolean },
{ name: "directory", alias: "d", type: String, value: process.cwd() }, { name: "directory", alias: "d", type: String, value: process.cwd() },
{ name: "config", type: Boolean }, { name: "config", type: Boolean },
{ name: "compress", alias: "c", type: Boolean } { name: "compress", alias: "c", type: Boolean }
]);
]).parse();
} catch(err){ } catch(err){
halt(err.message); halt(err.message);
} }

6
package.json

@ -14,14 +14,14 @@
"repository": "https://github.com/75lb/local-web-server", "repository": "https://github.com/75lb/local-web-server",
"author": "Lloyd Brookes", "author": "Lloyd Brookes",
"dependencies": { "dependencies": {
"command-line-args": "~0.0.2",
"command-line-args": "^0.2.0",
"compression": "^1.0.2", "compression": "^1.0.2",
"config-master": "~0.1.0", "config-master": "~0.1.0",
"connect": "^3.0.0", "connect": "^3.0.0",
"console-dope": "~0.3.0",
"console-dope": "^0.3.0",
"morgan": "^1.0.0", "morgan": "^1.0.0",
"serve-index": "^1.0.2", "serve-index": "^1.0.2",
"serve-static": "^1.1.0", "serve-static": "^1.1.0",
"wodge": "~0.6.0"
"wodge": "^0.7.0"
} }
} }
Loading…
Cancel
Save