Skip to content

Commit

Permalink
add usage info
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrbrandt committed Apr 5, 2013
1 parent 5771560 commit aae1a3a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
24 changes: 20 additions & 4 deletions bin/serf-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,38 @@

// TODO: "open" option only works on mac in single-process mode.
// Should notify when those conditions aren't met that the
// option is ignored. Also, should have usage info.
// option is ignored.

var argv = optimist["default"]({
"i": "127.0.0.1",
"p": "8080",
"n": "noname",
"c": 0,
"o": false
"o": false,
"h": false
}).alias({
"i": "ip",
"p": "port",
"n": "name",
"c": "children",
"o": "open",
}).argv;

"h": "help"
}).describe({
"config": "path to config file. If a config file is provided, overrides all other options",
"i": "ip address for a static server at current directory",
"p": "port for a static server at current directory",
"n": "name of static server (for logging) at current directory",
"c": "number of child processes to launch",
"o": "open url of server in default browser (mac/single-process only)",
"h": "display help message",
}).usage("Usage: $0 [options]")
.argv;

if (argv.help) {
console.log(optimist.help());
process.exit(0);
}

if (argv.config) {
config = require(path.resolve(process.cwd(), argv.config));
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "serf",
"version": "0.0.7",
"version": "0.0.8",
"description": "really simple webserver",
"main": "launcher.js",
"scripts": {
Expand Down

0 comments on commit aae1a3a

Please sign in to comment.