lib/cli/jenkins.js
function discover(cb) {
  return function (host, args) {
    if (!args) {
      args = host || {};
      host = 'localhost';
    }
    function resultCb(result) {
      console.log(text.__('Jenkins ver. %s is running on %s'),
          result.hudson.version[0],
          (result.hudson.url && result.hudson.url[0]) ? result.hudson.url[0] : host);
    }
    function jenkinsCb(jenkins) {
      jenkins.discover(host, cli.exitCb(null, resultCb));
    }
    cb(args, jenkinsCb);
  };
}
function discover(cb) {
  return function (host, args) {
    if (!args) {
      args = host || {};
      host = 'localhost';
    }
    function resultCb(result) {
      console.log(text.__('Jenkins ver. %s is running on %s'),
          result.hudson.version[0],
          (result.hudson.url && result.hudson.url[0]) ? result.hudson.url[0] : host);
    }
    function jenkinsCb(jenkins) {
      jenkins.discover(host, cli.exitCb(null, resultCb));
    }
    cb(args, jenkinsCb);
  };
}
function discover ( cb ) { return function ( host , args ) { if ( ! args ) { args = host || { } ; host = 'localhost' ; } function resultCb ( result ) { console . log ( text . __ ( 'Jenkins ver. %s is running on %s' ) , result . hudson . version [ 0 ] , ( result . hudson . url && result . hudson . url [ 0 ] ) ? result . hudson . url [ 0 ] : host ) ; } function jenkinsCb ( jenkins ) { jenkins . discover ( host , cli . exitCb ( null , resultCb ) ) ; } cb ( args , jenkinsCb ) ; } ; }
Get a handler that calls Jenkins API to discover a Jenkins instance on specified host.

@param {Function} cb: callback for argument handling
@return Jenkins API handler function
Get a handler that calls Jenkins API to discover a Jenkins instance on specified host .