var logger = require('./logger.js');

var PromptChain = function() {
  var prompt = require('prompt');
  var zero;

  var that = this;
  var idle = true;

  this.base_arr;
  this.base_callback;

  this.get = function(arr, callback) {
    if (zero === undefined) {
      zero = {
        arr: arr,
        callback: callback
      };

      prompt.start();
    }

    prompt.get(arr, function (err, result) {
      idle = false;
      callback(err, result);
    });
  };

  this.reset = function() {
    idle = true;
    this.get(zero.arr, zero.callback);
  }

};


module.exports = new PromptChain();
