
'use strict';

var prompt = require('prompt'),
    RSVP = require('rsvp');

prompt.message = '[' + '?'.green + ']';
prompt.delimiter = ' ';

exports.get = function(properties) {
  return new RSVP.Promise(function(resolve, reject) {
    prompt.start();
    prompt.get(properties, function(err, answers) {
      if (err) {
        reject(err);
      } else {
        resolve(answers);
      }
    });
  });
};
@@ -401,8 +401,709 @@
   %7D);%0A%7D;
+%0A%0Aexports.confirm = function(description, defaultYes) %7B%0A  var defaultValue = defaultYes ? 'Y/n' : 'y/N';%0A  return new RSVP.Promise(function(resolve, reject) %7B%0A    exports.get(%5B%7B%0A      name: 'confirm',%0A      description: description,%0A      default: defaultValue,%0A      pattern: /%5E(y(es)?%7Cno?%7Cy%5C/n)$/i,%0A      message: 'Please answer y or n',%0A      required: true,%0A      before: function(value) %7B%0A        return value === defaultValue ? (defaultYes ? 'y' : 'n') : value;%0A      %7D%0A    %7D%5D).then(function(answers) %7B%0A      resolve(/%5Ey/.test(answers.confirm));%0A    %7D).catch(function(reason) %7B%0A      reject(%7B%0A        reason: 'Failed to prompt for confirmation',%0A        help: reason%0A      %7D);%0A    %7D);%0A  %7D);%0A%0A%0A%7D;

Add prompt confirm