Skip to content

Commit

Permalink
--help is the default argument now, if no other argument is given
Browse files Browse the repository at this point in the history
  • Loading branch information
Arian committed May 3, 2012
1 parent b7a190f commit b5971db
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bin/_cover.js
Expand Up @@ -14,8 +14,11 @@ var dir;
var recursive = false;
var excludes = [];

for (var i = 2; i < process.argv.length; i++){
var arg = process.argv[i];
var args = process.argv.slice(2);
if (!args.length) args.push('--help');

for (var i = 0; i < args.length; i++){
var arg = args[i];

if (arg == '--version' || arg == '-v'){
console.log(pack.version);
Expand All @@ -24,7 +27,7 @@ for (var i = 2; i < process.argv.length; i++){
}

if (arg == '--output' || arg == '-o'){
dir = process.argv[++i];
dir = args[++i];
continue;
}

Expand All @@ -34,7 +37,7 @@ for (var i = 2; i < process.argv.length; i++){
}

if (arg == '--exclude' || arg == '-e'){
excludes.push(process.argv[++i]);
excludes.push(args[++i]);
continue;
}

Expand Down Expand Up @@ -111,7 +114,6 @@ var processFile = function(file){
files.forEach(function(_file){

var __file = path.normalize(file + '/' + _file);
console.log(__file, excludes);
if (_file != '..' && _file != '.' && excludes.indexOf(__file) == -1){

var fn = processFile(file + '/' + _file);
Expand Down

0 comments on commit b5971db

Please sign in to comment.