Permalink
Browse files

Merge pull request #577 from trevorgerhardt/debug-flag

Added --debug flags, closes #531
  • Loading branch information...
trevorgerhardt committed Jun 17, 2014
2 parents 5206e5d + bb3701c commit c607a7a6933c7693ff013e4b4211f34f3720b0d5
View
@@ -16,6 +16,7 @@ program
.option('-b, --browsers <string>', 'browsers to support with autoprefixer')
.option('-c, --copy', 'copy files instead of linking')
.option('--umd', 'alias for --standalone')
+ .option('--debug', 'turn on debug statements');
// examples
@@ -41,6 +42,8 @@ program.on('--help', function(){
program.parse(process.argv);
+if (program.debug) require('debug').enable('component-build*,component-consoler*,component-resolver*');
+
var Resolve = require('component-resolver');
var utils = require('component-consoler');
var Build = require('component-build');
View
@@ -6,10 +6,14 @@
var program = require('commander');
-program.usage('<user|organization>...');
+program
+ .usage('<user|organization>...')
+ .option('--debug', 'turn on debug statements');
program.parse(process.argv);
+if (program.debug) require('debug').enable('component-consoler*');
+
var request = require('superagent');
var utils = require('component-consoler');
View
@@ -4,8 +4,11 @@ var program = require('commander');
program
.option('-d, --dev', 'check development dependencies')
+ .option('--debug', 'turn on debug statements')
.parse(process.argv);
+if (program.debug) require('debug').enable('component-consoler*,component-flatten*,component-resolver*');
+
var resolve = require('component-resolver');
var flatten = require('component-flatten');
var utils = require('component-consoler');
View
@@ -10,6 +10,7 @@ program
.usage('[name ...]')
.option('-d, --dev', 'install development dependencies')
.option('-p, --proxy', 'use a proxy, eg. http://localhost:3128')
+ .option('--debug', 'turn on debug statements')
// .option('-p, --proxy <proxy>', 'use a proxy, eg. http://localhost:3128')
.parse(process.argv);
@@ -38,6 +39,8 @@ program.on('--help', function(){
process.exit();
});
+if (program.debug) require('debug').enable('component-consoler*,component-resolver*');
+
var resolve = require('component-resolver');
var utils = require('component-consoler');
var semver = require('semver');
View
@@ -5,7 +5,8 @@ var program = require('commander');
program
.usage('[../path/to/folder]')
.option('-t, --tag <str>', 'link as a specific version/tag/commit/branch')
- .option('-r, --repository <str>', 'link as a specific repository');
+ .option('-r, --repository <str>', 'link as a specific repository')
+ .option('--debug', 'turn on debug statements');
program.on('--help', function() {
console.log(' Example: ');
@@ -17,6 +18,8 @@ program.on('--help', function() {
program.parse(process.argv);
+if (program.debug) require('debug').enable('component-consoler*');
+
var fs = require('fs');
var path = require('path');
var mkdirp = require('mkdirp');
View
@@ -6,8 +6,11 @@ var program = require('commander');
program
.option('-d, --depth <n>', 'set the depth to <n>', Infinity)
+ .option('--debug', 'turn on debug statements')
.parse(process.argv);
+if (program.debug) require('debug').enable('component-consoler*,component-ls*,component-resolver*');
+
var resolve = require('component-resolver');
var utils = require('component-consoler');
var ls = require('component-ls');
View
@@ -4,8 +4,11 @@ var program = require('commander');
program
.option('-d, --dev', 'update development dependencies')
+ .option('--debug', 'turn on debug statements')
.parse(process.argv);
+if (program.debug) require('debug').enable('component-consoler*,component-outdated2*,component-resolver*');
+
var fatal = require('component-consoler').fatal;
var outdated = require('component-outdated2');
var resolve = require('component-resolver');
View
@@ -4,8 +4,11 @@ var program = require('commander');
program
.option('-d, --dev', 'pin development dependencies')
+ .option('--debug', 'turn on debug statements')
.parse(process.argv);
+if (program.debug) require('debug').enable('component-consoler*,component-pin*,component-resolver*');
+
var fatal = require('component-consoler').fatal;
var resolve = require('component-resolver');
var pin = require('component-pin');
View
@@ -12,8 +12,11 @@ program
.option('-f, --force', 'force redownloading the cache')
.option('-m, --maxage <seconds>', 'redownload the cache if older than <maxage>'. parseInt)
.option('-v, --verbose', 'verbose output')
+ .option('--debug', 'turn on debug statements')
.parse(process.argv);
+if (program.debug) require('debug').enable('component-consoler*,component-search*');
+
var co = require('co');
var utils = require('component-consoler');
var search = co(require('component-search2'));
View
@@ -4,8 +4,11 @@ var program = require('commander');
program
.option('-d, --dev', 'update development dependencies')
+ .option('--debug', 'turn on debug statements')
.parse(process.argv);
+if (program.debug) require('debug').enable('component-consoler*,component-resolver*,component-updater*');
+
var fatal = require('component-consoler').fatal;
var resolve = require('component-resolver');
var update = require('component-updater');
View
@@ -2,7 +2,11 @@
var program = require('commander');
-program.parse(process.argv);
+program
+ .option('--debug', 'turn on debug statements')
+ .parse(process.argv);
+
+if (program.debug) require('debug').enable('component-consoler*,component-resolver*');
var resolve = require('component-resolver');
var fatal = require('component-consoler').fatal;

0 comments on commit c607a7a

Please sign in to comment.