Skip to content

Commit

Permalink
(new) added more options to bin
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed Jun 17, 2010
1 parent 75ff4ab commit 82f6e5e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions bin/vows
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ var _reporter = require('vows/reporters/dot-matrix'), reporter = {
name: _reporter.name,
};

var help = [
"usage: vows [FILE, ...] [options]",
"",
"options:",
" -v, --verbose Enable verbose output",
" -w, --watch Watch mode",
" -s, --silent Don't report",
" -m'abc' Only run tests matching the string",
" -r'^abc$' Only run tests matching the regexp",
" --json Use JSON reporter",
" --spec Use Spec reporter",
" --dot-matrix Use Dot-Matrix reporter",
//" --no-color Don't use terminal colors",
" --version Show version",
" -h, --help You're staring at it"
].join('\n');

var options = {
reporter: reporter,
matcher: /.*/,
Expand Down Expand Up @@ -64,6 +81,13 @@ while (arg = argv.shift()) {
case 'spec':
_reporter = require('vows/reporters/spec');
break;
case 'dot-matrix':
_reporter = require('vows/reporters/dot-matrix');
break;
case 'silent':
case 's':
_reporter = require('vows/reporters/silent');
break;
case 'verbose':
case 'v':
options.verbose = true;
Expand All @@ -72,6 +96,19 @@ while (arg = argv.shift()) {
case 'w':
options.watch = true;
break;
case 'no-color':
options.nocolor = true;
break;
case 'version':
sys.print('vows ');
sys.puts(fs.readFileSync(path.join(__dirname, '..', 'package.json'))
.toString().match(/"version"\s*:\s*"([\d.]+)"/)[1]);
process.exit(0);
case 'help':
case 'h':
sys.puts(help);
process.exit(0);
break;
}
}
}
Expand Down

0 comments on commit 82f6e5e

Please sign in to comment.