#! /usr/bin/env node

var glob = require('glob');
var path = require('path');
var exec = require('child_process').exec;
var fs = require('fs');
var program = require('commander');

program.arguments('<files>')
  .option('-i, --ignore <ignore>', 'Files to ignore')
  .option('-c, --config <config>', 'Configuration file for jsdoc')
  .action(function(files) {
    var options = {};

    if (program.ignore) {
      options.ignore = program.ignore;
    }

    var globFiles = glob.sync(files, options);

    globFiles.forEach(f => {
      // Don't write the file if it would be empty
      exec(
        './node_modules/jsdoc-to-markdown/bin.js ' +
        f + (program.config ? (' -c ' + program.config + ' ') : ''),
        function (error, stdout, stderr) {
          if (error || stdout) {
            console.error(error || stdout);
          }

          if (stdout.trim() !== '') {
            fs.writeFile(f.replace('.js', '.md'), stdout, function callback() {
              console.log('>>> Generated docs for ' + f);
            });
          }
        }
      );
    });
  })
  .parse(process.argv);

@@ -234,16 +234,19 @@
  %3Cignore
+...
 %3E', 'Fil
@@ -327,16 +327,94 @@
 jsdoc')%0A
+  .option('-v, --verbose', 'Print out all files we look at and their result')%0A
   .actio
@@ -576,16 +576,216 @@
 ions);%0A%0A
+    if (program.verbose) %7B%0A      console.log('%3E Checking the following files:');%0A      globFiles.forEach(f =%3E console.log('%3E%3E%3E ' + f));%0A      console.log('');%0A%0A      console.log('%3E Parsing:');%0A    %7D%0A%0A
     glob
@@ -1059,19 +1059,19 @@
 r %7C%7C std
-out
+err
 ) %7B%0A    
@@ -1104,19 +1104,19 @@
 r %7C%7C std
-out
+err
 );%0A     
@@ -1259,65 +1259,254 @@
     
-console.log('%3E%3E%3E Generated docs for ' + f);%0A            %7D
+program.verbose ? console.log('%3E%3E ' + f) : null;%0A              console.log('%3E%3E%3E Generated docs for ' + f);%0A            %7D);%0A          %7D else if (program.verbose) %7B%0A            console.log('%3E%3E ' + f);%0A            console.log('%3E%3E%3E No docs generated'
 );%0A 

Add verbose flag, don't print stdout