Prompt the user for feedback.

@param {Object} `file`
@param {Function} `cb`
335944
function ask(file, opts, cb) {
  if (typeof opts === 'function') {
    cb = opts;
    opts = {};
  }
  opts = opts || {};
  var prompt = lazy.inquirer.createPromptModule();
  var fp = path.relative(process.cwd(), file.path);

  var questions = {
    name: 'action',
    type: 'expand',
    message: 'Overwrite `' + fp + '`?',
    value: 'nothing',
    choices: [{
      key: 'n',
      name: 'do not overwrite',
      value: 'skip'
    }, {
      key: 'y',
      name: 'overwrite',
      value: 'write'
    }, {
      key: 'a',
      name: 'overwrite this and all others',
      value: 'force'
    }, {
      key: 'x',
      name: 'abort',
      value: 'abort'
    }, {
      key: 'd',
      name: 'diff comparison between the current and new:',
      value: 'diff'
    }]
  };

  prompt([questions], function (answers) {
    var msg = answers.action;

    switch(answers.action) {
      case 'skip':
        cb(answers.action);
        process.exit(0);

      case 'abort':
        msg = utils.red(utils.error) + ' Aborted. No action was taken.';
        if (!opts.silent) console.log(msg);
        cb(answers.action);
        process.exit(0);

      case 'diff':
        var existing = opts.existing || fs.readFileSync(fp, 'utf8');
        if (lazy.isBinary(existing) && typeof opts.binaryDiff === 'function') {
          opts.binaryDiff(existing, file.contents);
        } else {
          stringDiff(existing, file.contents.toString());
        }
        return ask(file, opts, cb);

      case 'force':
        opts.force = true;
        break;

      case 'write':
        msg = utils.green(utils.success) + ' file written to';
        opts.force = true;
        break;

      default: {
        msg = utils.red(utils.error) + utils.red(' Aborted.') + ' No action was taken.';
        if (!opts.silent) console.log(msg);
        cb(answers.action);
        process.exit(0);
      }
    }

    var rel = path.relative(process.cwd(), fp);
    var filepath = utils[answers.action](rel);
    if (!opts.silent) {
      console.log(msg, filepath);
    }
    return cb(answers.action);
  });
}
226205
function writeFile(path, contents, mode, cb) {
    fs.writeFile(path, contents, {mode: mode || 0666, encoding: 'utf8'}, function (err) {
        if (err) { throw err; }
        console.info(cliStyles.cyan + '\tcreate' + cliStyles.reset + ': ' + path);
        cb();
    });
}
588699
function ask(cb) {
  return function(app) {
    app.use(store('smithy'))
      .use(questions())
      .ask(function(err, answers) {
        if (err) return cb(err);

        cb.call(app, null, answers);
      });

    app.asyncHelper('ask', function(key, options, cb) {
      app.questions.options.force = true;
      app.ask(key, function(err, res) {
        if (err) return cb(err);
        cb(null, res[key]);
      });
    });
  };
}
418067
function _segment(file) {
  console.log();
  process.stdout.write(util.format('%s ', file));
}
937867
function resolveAllWriteQueueCallbacks(file, error) {
	writeQueue[file].callbacks.forEach(cb => cb(error));
}
613548
function(file, enc, cb) {
      if (
        !file.isNull() &&
        !file.isDirectory() &&
        options.extensions.some(function(ext) {
          return path.extname(file.path).substr(1).toLowerCase() === ext;
        })
      ) {
        file = retina.tapFile(file, cb);
      } else {
        cb();
      }
      // Push only if file is returned by retina (otherwise it is dropped from stream)
      if (file) this.push(file);
    }
452921
def prompt(text, default=None, show_default=True, invisible=False,
           confirm=False, skip=False, type=None, input_function=None):
	'''
	'''
	t = determine_type(type, default)
	input_function = get_input_fn(input_function, invisible)
	if default is not None and show_default:
		text = '{} [{}]: '.format(text, default)
	while True:
		val = prompt_fn(input_function, text, default, t, skip, repeat=True)
		if not confirm or (skip and val is None):
			return val
		if val == prompt_fn(input_function, 'Confirm: ', default, t, repeat=True):
			return val
		echo('Error: The two values you entered do not match', True)
933780
function send(err, reply, cb) {

  // invoke before function, used to end a slowlog
  // timer before sending output
  if(this.before) this.before();

  if(this.cb) {
    return this.cb(err, reply);
  }
  this.conn.write(err || reply, cb);
}
311114
function(src, dest){
      self.logger.warn('File at '+dest+' exists, overwrite?');
      
      rl.question('(yN) ', function(answer){
        switch(answer.toLowerCase()){
          case 'y':
            this.copy(src, dest); 
            this.triggerNext(); 
            break; 
          case 'n':
            this.triggerNext(); 
            break; 
          default:
            this.waitForResponse(src, dest); 
            break; 
        }
      }.bind(this)); 
    }
837432
function readInput(cb, filename) {

    function readFile() {
      fs.readFile(filename, 'utf8', function (err, text) {
        if (err) {
          console.error("[ERROR] couldn't read from '" + filename + "':");
          console.error(err.message);
          return;
        }

        cb(err, text);
      });
    }

    function readStdin() {
      var text = ''
        , stdin = process.stdin
        ;

      stdin.resume();

      stdin.on('data', function (chunk) {
        text += chunk;
      });

      stdin.on('end', function () {
        cb(null, text);
      });
    }

    if (filename) {
      readFile();
    }
    else {
      readStdin();
    }

  }
506703
function(options, cb) {
  if (os_name == 'windows') {
    path_arg = path.resolve(options.path);
    name_arg = path.resolve(options.name);
  } else {
    path_arg = '"' + options.path + '"';
    name_arg = '"' + options.name + '"';
  }
  var opts = {
    user: options.user,
    bin: node_bin,
    type: 'exec',
    args: [path.join(__dirname, 'upload.js'), path_arg, options.user, name_arg, options.size, options.file_id, options.total, options.port],
    opts: {
      env: process.env
    }
  };

  run_as_user(opts, function(err, out) {
    if (err) {
      logger.error("Upload error: " + err.message);
      return;
    }
    logger.info("Ran as user: " + out);
    if (out.indexOf("File succesfuly uploaded") != -1) {
      files.del(options.file_id);
      return;
    }
    if (out.includes("EPIPE") || out.includes("EACCES")) {
      files.update(options.file_id, options.path, options.size, options.user, options.name, options.resumable, function(err) {
        if (err) logger.error("Database update error");
        logger.info("Resume file option activated for ID: " + options.file_id);
      });
    }
  });
}
602081
function(content, opts, onOk, oncancel) {
        Dialog.setup('prompt', content, opts, onOk, oncancel);
      }
543787
function Prompt() {
  BasePrompt.apply(this, arguments);
  if (typeof this.question.source !== 'function') {
    throw new TypeError('expected source to be defined');
  }

  this.currentChoices = [];
  this.firstRender = true;
  this.selected = 0;

  // Make sure no default is set (so it won't be printed)
  this.question.default = undefined;
  this.paginator = new Paginator();
}
255077
function(file) {
    var link = document.createElement("link")
    link.href = file
    link.type = "text/css"
    link.rel = "stylesheet"
    link.media = "screen,print"
    document.getElementsByTagName("head")[0].appendChild(link)
  }
987267
function showPrompt() {
    let prompt = ""
    for (i = 1; i <= 9; i++) {
      prompt += numChar[i] + " :" + fruitCharacter[i] + "  "
    }
    let iprompt = interactive ? `'x' to eXit.` : ""
    log(
      `Press a number to download a fruit (higher numbers take longer). ${iprompt}
  ${prompt}
      `
    )
  }
505911
function(input_file_obj, property_buffer_raw_input_file, 
                                    property_buffer_input_file, cb_post_process, cb_when_done) {

    // console.log("thuthuthu IIIIIIIII inside read_file_into_buffer   filename ", input_file_obj.filename);


    // console.log("thuthuthu IIIIIIIII cb_when_done ", cb_when_done.name);
    // console.log("thuthuthu IIIIIIIII cb_post_process ", cb_post_process.name);





    var input_read_stream = fs.createReadStream(input_file_obj.filename);

    // var max_print_count = 5;
    // var curr_print_count = 0;

    var current_byte_count = 0;

    // var size_limit_buffer;

    input_read_stream.on('readable', function() {

        var newData;

        // console.log('inside READABLEEEEEEEEEE of read_file_into_buffer ');

        while (null !== (newData = input_read_stream.read())) {

            // if (curr_print_count < max_print_count) {

            //     console.log('CCCCCC binary newData length this callback cycle is ', newData.length);
            // }

            // size_limit_buffer = (newData.length < limit_size_input_file_buffer) ?
            //                      newData.length : limit_size_input_file_buffer;

            // console.log("size_limit_buffer ", size_limit_buffer);

            input_file_obj[property_buffer_raw_input_file] = 
                    Buffer.concat([input_file_obj[property_buffer_raw_input_file], newData], 
                                   input_file_obj[property_buffer_raw_input_file].length+newData.length);


            // var index = 44;
            // for (; index < 50; index++) {

            //     console.log(index, ' SSSSSSSSS  ', input_file_obj[property_buffer_raw_input_file][index]);
            // };

            // input_file_obj[property_buffer_raw_input_file] = 
            //         Buffer.concat([input_file_obj[property_buffer_raw_input_file], newData], 
            //                        input_file_obj[property_buffer_raw_input_file].length+size_limit_buffer);


            // if (curr_print_count < max_print_count) {

            // console.log('binary input_file_obj.raw_buffer length post concat  ', 
            //                 input_file_obj[property_buffer_raw_input_file].length);
            // }
            // curr_print_count++;
        }
    });

    input_read_stream.on("error", function (error) {

        console.error("ERROR - failure when attempting to read input file : ", input_file_obj.filename, error);
        // process.exit(8);

        new Error("ERROR - failure when attempting to read input file : ", input_file_obj.filename, error);

    });

    // Done, process the data

    input_read_stream.on("end", function () {


        // do something with data read from file - parse_wav

        // console.log("INNN read_file_into_buffer with cb_post_process.name ",cb_post_process.name);

        cb_post_process(input_file_obj, property_buffer_raw_input_file, property_buffer_input_file, cb_when_done);

        // ---

        // console.log("post callback to parse_wav with property iteration of input_file_obj");
    });

}
840124
function openFile(file) {
      var edit;
      if (!editor || gui) {
        open(file);
      } else {
        edit = spawn(editor, [file], {stdio: 'inherit'});
        edit.on('exit', process.exit);
      }
    }