lib/index.js
function (gen) {
  var main = co.wrap(gen)
  const controller = new Controller()
  
  function finish () {
    controller.destroy()
    return controller.answers
  }
  
  function error (error) {
    console.error(error.stack)
  }
  
  return main(function (config) {
    return controller.prompt(config)
  }, register).then(finish, error)
}
function (gen) {
  var main = co.wrap(gen)
  const controller = new Controller()
  
  function finish () {
    controller.destroy()
    return controller.answers
  }
  
  function error (error) {
    console.error(error.stack)
  }
  
  return main(function (config) {
    return controller.prompt(config)
  }, register).then(finish, error)
}
function ( gen ) { var main = co . wrap ( gen ) const controller = new Controller ( ) function finish ( ) { controller . destroy ( ) return controller . answers } function error ( error ) { console . error ( error . stack ) } return main ( function ( config ) { return controller . prompt ( config ) } , register ) . then ( finish , error ) }
Method to run a generator for interative command line program.

@param {Generator} gen The generator to put program.
@returns {Promise} The Promise to end program and take answers.
Method to run a generator for interative command line program .