var program = require('commander'),
    apiController = require('./apis/apiController')
    colors = require('colors'),
    ran = false;

var testCb = function(result, apiCall) {
  console.log('Test results for ' + apiCall.bold);
  if(result === true) {
    process.exit(0);
  } else {
    for(var i = 0; i < result.length; i++) {
      var info = result[i];
      switch(info.severity) {
        case 'info':
          console.log('Info:'.underline.green);
          break;
        case 'warning':
          console.log('Warning:'.underline.yellow);
          break;
        case 'breaking':
          process.exitCode = 1;
          console.log('Breaking API change:'.underline.red);
          break;
      }
    }
    console.log(info.type + ': (' + info.path + ')');
    console.log('old type: ' + info.oldType);
    console.log('new type: ' + info.newType)
    if(program.verbose) {
      console.log('old data: ', info.oldData);
      console.log('new data: ', info.newData);
    }
  }
}

program.arguments('[apiPath]')
  .option('-v, --verbose', 'show api dump')
  .action(function(apiPath, options) {
    ran = true;
    if(apiPath) {
      apiController.testApi(apiPath, testCb);
    }
  })
  .parse(process.argv);

if(!ran) {
   apiController.testAll(testCb);
 }

@@ -706,16 +706,85 @@
     
+  default:%0A          console.log('Unkown severity'.underline.red);%0A      
 %7D%0A  
-  %7D%0A
     
@@ -833,16 +833,18 @@
 + ')');%0A
+  
     cons
@@ -881,24 +881,26 @@
 dType);%0A    
+  
 console.log(
@@ -932,16 +932,18 @@
 pe)%0A    
+  
 if(progr
@@ -958,24 +958,26 @@
 se) %7B%0A      
+ 
+ 
 console.log(
@@ -1003,32 +1003,34 @@
 oldData);%0A      
+  
 console.log('new
@@ -1050,24 +1050,32 @@
 o.newData);%0A
+      %7D%0A
     %7D%0A  %7D%0A%7D%0A

make test output better