Skip to content

Commit

Permalink
Added -c, --colors. Closes #69
Browse files Browse the repository at this point in the history
bit of a hack with commander.js due to --no-colors
defaulting program.colors to true, yet we want to
default mocha colors to isatty() unless explicitly
given --colors, but hey it works
  • Loading branch information
tj committed Nov 24, 2011
1 parent db2b3f7 commit 7f42301
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/mocha
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ program
.option('-t, --timeout <ms>', 'set test-case timeout in milliseconds [2000]')
.option('-s, --slow <ms>', '"slow" test threshold in milliseconds [75]', parseInt)
.option('-C, --no-colors', 'force disabling of colors')
.option('-c, --colors', 'force enabling of colors')
.option('-G, --growl', 'enable growl support')

// report help
Expand Down Expand Up @@ -97,6 +98,13 @@ var suite = new Suite('')

if (!program.colors) Base.useColors = false;

// --colors

if (~process.argv.indexOf('--colors') ||
~process.argv.indexOf('-c')) {
Base.useColors = true;
}

// --slow <ms>

if (program.slow) Base.slow = program.slow;
Expand Down

0 comments on commit 7f42301

Please sign in to comment.