Skip to content

Commit

Permalink
Added -p, --port NUM
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Jun 28, 2010
1 parent 61e7ac5 commit 815b45b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion bin/expresso
Expand Up @@ -43,6 +43,12 @@ var failed = 0;

var boring = false;

/**
* Server port.
*/

var port = 5555;

/**
* Usage documentation.
*/
Expand All @@ -54,6 +60,7 @@ var usage = ''
+ '\n -c, --coverage Generate and report test coverage'
+ '\n -r, --require PATH Require the given module path'
+ '\n -I, --include PATH Unshift the given path to require.paths'
+ '\n -p, --port NUM Port number for test servers, starts at 5555'
+ '\n -b, --boring Suppress ansi-escape colors'
+ '\n -v, --version Output version number'
+ '\n -h, --help Display help information'
Expand Down Expand Up @@ -86,6 +93,14 @@ while (args.length) {
throw new Error('--include requires a path');
}
break;
case '-p':
case '--port':
if (arg = args.shift()) {
port = parseInt(arg, 10);
} else {
throw new Error('--port requires a number');
}
break;
case '-r':
case '--require':
if (arg = args.shift()) {
Expand Down Expand Up @@ -155,7 +170,7 @@ assert.eql = assert.deepEqual;
* @param {String} msg
* @api public
*/
var port = 5555; // TODO: flag

assert.response = function(server, req, res, msg){
msg = msg || assert.testTitle;
msg += '. ';
Expand Down

0 comments on commit 815b45b

Please sign in to comment.