import prompt from 'prompt'
import chalk from 'chalk'

module.exports = function(value, options) {

  var getKeywords = function(value, cb){

    if(typeof(value) === 'string'){
      cb(null, value)

    } else {
      var schema = {
        properties: {
          keyword: {
            description: chalk.white('keyword:'),
            pattern: /^[a-zA-Z0-9][a-zA-Z0-9-_\.]+$/,
            message: 'keyword must be letters, digits, dashes, underscores and dots.',
            required: true
          }
        }
      }

      prompt.message = ''
      prompt.delimiter = ''
      prompt.start();

      prompt.get(schema, function (err, result) {
          cb(err, result.keyword)
      })
    }
  }

  getKeywords(value, function(err, data){
     if (err) return console.error(err);
     console.log("You are actualy looking for: "+ data);
  })

}

@@ -46,16 +46,47 @@
  'chalk'
+%0Aimport Promise from 'bluebird'
 %0A%0Amodule
@@ -105,21 +105,24 @@
 unction(
-value
+argument
 , option
@@ -129,19 +129,21 @@
 s) %7B%0A%0A  
-var
+const
  getKeyw
@@ -153,27 +153,37 @@
 s = 
-function(value, cb)
+Promise.method((argument) =%3E 
 %7B%0A%0A 
@@ -195,21 +195,24 @@
 (typeof(
-value
+argument
 ) === 's
@@ -230,24 +230,24 @@
     
-cb(null, value)%0A
+return argument;
 %0A   
@@ -656,250 +656,301 @@
     
-prompt.get(schema, function (err, result) %7B%0A          cb(err, result.keyword)%0A      %7D)%0A    %7D%0A  %7D%0A%0A  getKeywords(value, function(err, data)%7B%0A     if (err) return console.error(err);%0A     console.log(%22You are actualy looking for: %22+ data);%0A  %7D)%0A
+return Promise.fromCallback(function (callback)%7B%0A        prompt.get(schema, callback)%0A      %7D)%0A      .then((result) =%3E result.keyword)%0A%0A    %7D%0A  %7D)%0A%0A  const printResult = (keyword) =%3E %7B%0A    console.log(%22You are actualy looking for: %22+ keyword);%0A  %7D%0A%0A  getKeywords(argument)%0A%0A  .then(printResult)
 %0A%7D%0A

Refactor search cli