lib/cli/jenkins.js
function executor(cb) {
  return function (args) {
    function resultCb(result) {

      var computers = result.computer;

      if (_.isEmpty(computers)) {
        console.log(text.__('No executor found'));
      } else {

        var data = Jenkins.executorSummary(computers);

        _.keys(data).forEach(function (computer) {
          console.log('+ %s | %s', computer, data[computer].summary);
          data[computer].executors.forEach(function (executor) {
            if (!executor.idle) {
              console.log('  - %s | %s%%s', executor.name, executor.progress, (executor.stuck) ? text.__(' stuck!') : '');
            }
          });
        });

      }
    }
    function jenkinsCb(jenkins) {
      jenkins.computer(cli.exitCb(null, resultCb));
    }
    cb(args, jenkinsCb);
  };
}
function executor(cb) {
  return function (args) {
    function resultCb(result) {

      var computers = result.computer;

      if (_.isEmpty(computers)) {
        console.log(text.__('No executor found'));
      } else {

        var data = Jenkins.executorSummary(computers);

        _.keys(data).forEach(function (computer) {
          console.log('+ %s | %s', computer, data[computer].summary);
          data[computer].executors.forEach(function (executor) {
            if (!executor.idle) {
              console.log('  - %s | %s%%s', executor.name, executor.progress, (executor.stuck) ? text.__(' stuck!') : '');
            }
          });
        });

      }
    }
    function jenkinsCb(jenkins) {
      jenkins.computer(cli.exitCb(null, resultCb));
    }
    cb(args, jenkinsCb);
  };
}
function executor ( cb ) { return function ( args ) { function resultCb ( result ) { var computers = result . computer ; if ( _ . isEmpty ( computers ) ) { console . log ( text . __ ( 'No executor found' ) ) ; } else { var data = Jenkins . executorSummary ( computers ) ; _ . keys ( data ) . forEach ( function ( computer ) { console . log ( '+ %s | %s' , computer , data [ computer ] . summary ) ; data [ computer ] . executors . forEach ( function ( executor ) { if ( ! executor . idle ) { console . log ( '  - %s | %s%%s' , executor . name , executor . progress , ( executor . stuck ) ? text . __ ( ' stuck!' ) : '' ) ; } } ) ; } ) ; } } function jenkinsCb ( jenkins ) { jenkins . computer ( cli . exitCb ( null , resultCb ) ) ; } cb ( args , jenkinsCb ) ; } ; }
Get a handler that calls Jenkins API to display executors information per computer

@param {Function} cb: callback for argument handling
@return Jenkins API handler function
Get a handler that calls Jenkins API to display executors information per computer