Prompt the user to install a starterkit
@param  {Array}     the starterkit suggestions
177006
protected static function promptStarterKitInstall($starterKitSuggestions) {
		
		Console::writeLine("");
		
		// suggest starterkits
		Console::writeInfo("suggested starterkits that work with this edition:", false, true);
		foreach ($starterKitSuggestions as $i => $suggestion) {
			$num = $i + 1;
			Console::writeLine($num.": ".$suggestion, true);
		}
		
		// prompt for input on the suggestions
		Console::writeLine("");
		
		$prompt  = "choose an option or hit return to skip:";
		$options = "(ex. 1)";
		$input   = Console::promptInput($prompt,$options,"1");
		$result  = (int)$input - 1;
		
		if (isset($starterKitSuggestions[$result])) {
			
			Console::writeLine("");
			$f = new Fetch();
			$result = $f->fetchStarterKit($starterKitSuggestions[$result]);
			
		}
		
	}
1141900
protected function promptForProviderOrTag()
    {
        $choice = $this->choice(
            "Which provider or tag's files would you like to publish?",
            $choices = $this->publishableChoices()
        );

        if ($choice == $choices[0] || is_null($choice)) {
            return;
        }

        $this->parseChoice($choice);
    }
867859
function installRequirements(done) {
  var _calls = [];
  _.forEach(REQUIRED_INSTALLS, function(npmName) {
    _calls.push(function(done) {
      return Crux.util.install.npm(npmName, done, false);
    });
  });
  async.waterfall(_calls, done);
}
61081
function (callback) {
                var originalSuggestions = this._suggestions;
                var nbSuggestions = originalSuggestions.length;
                var returnedSuggestions = [];
                var suggestion;
                for (var index = 0; index < nbSuggestions; index++) {
                    suggestion = originalSuggestions[index];
                    returnedSuggestions.push(suggestion.original);
                }
                this.$callback(callback, returnedSuggestions);
            }
872987
function addPrefs(profile, options) {
  var userPrefs = options.prefs || {};

  return when.promise(function(resolve, reject) {
    Object.keys(userPrefs).forEach(function(key) {
      profile.setPreference(key, userPrefs[key]);
    });
    profile.updatePreferences();
    resolve(profile);
  });
}
1006956
function (res, args) {
                this._pendingRequestNb -= 1;

                var suggestions = null;
                var error = null;
                var repositionDropDown = false;
                var rangeValue = false;
                if (res != null) {
                    if ("suggestions" in res) {
                        suggestions = res.suggestions;
                        error = res.error;
                        repositionDropDown = res.repositionDropDown;
                        rangeValue = res.multipleValues;
                    } else {
                        suggestions = res;
                    }
                }

                // default selection is first element
                var nextValue = args.nextValue, triggerDropDown = args.triggerDropDown, matchValueIndex = -1, dataModel = this._dataModel;
                var allSuggestions = !!args.allSuggestions;

                // don't do anything if displayedValue has changed
                // -> user has typed something else before the callback returned
                if (dataModel && (nextValue == dataModel.text) || (args.keepSelectedValue)) {

                    // a null return is different from an empty array
                    // null : not enought letters
                    // empty array : no suggestions for this entry
                    var suggestionsAvailable = (suggestions !== null);

                    if (suggestionsAvailable) {
                        if (args.keepSelectedValue) {
                            var code = dataModel.value ? dataModel.value.code : null;
                            for (var i = 0; i < suggestions.length; i += 1) {
                                suggestions[i].exactMatch = (suggestions[i].code === code);
                            }
                        }
                        // reformat the suggestions to be compatible with the list widget
                        suggestions = allSuggestions ? suggestions : this._filterSuggestions(suggestions);
                        matchValueIndex = this._prepareSuggestionsAndMatch(suggestions, nextValue);

                    } else {
                        suggestions = [];
                    }
                    var hasSuggestions = suggestions.length > 0;
                    // for resetting focus when suggestions are empty
                    this._resetFocus = suggestions.length > 0 || !(this.expandButton);
                    aria.templates.RefreshManager.stop();
                    // as item are changed, force datamodel to change to activate selection
                    var jsonUtils = ariaUtilsJson;
                    jsonUtils.setValue(dataModel, 'selectedIdx', -1);

                    // update datamodel through setValue to update the list as well
                    jsonUtils.setValue(dataModel, 'listContent', suggestions);

                    if (rangeValue) {
                        var selectedValues = [];
                        for (var i = 0; i < dataModel.listContent.length; i++) {
                            selectedValues.push(dataModel.listContent[i].value);
                        }
                        jsonUtils.setValue(dataModel, 'multipleSelect', true);
                        jsonUtils.setValue(dataModel, 'selectedValues', selectedValues);
                        dataModel.value = selectedValues.length > 0 ? selectedValues : null;
                    } else if (allSuggestions) {
                        var selectedValues = [];
                        for (var i = 0; i < dataModel.listContent.length; i++) {
                            var index = this._findSuggestion(this.selectedSuggestions, dataModel.listContent[i].value);
                            if (index != -1) {
                                selectedValues.push(dataModel.listContent[i].value);
                            }
                        }
                        jsonUtils.setValue(dataModel, 'selectedValues', selectedValues);
                        jsonUtils.setValue(dataModel, 'multipleSelect', true);
                        dataModel.value = null;
                    } else {
                        if (matchValueIndex != -1) {
                            dataModel.value = dataModel.listContent[matchValueIndex].value;
                            jsonUtils.setValue(dataModel, 'selectedValues', [dataModel.value]);
                        } else {
                            jsonUtils.setValue(dataModel, 'selectedValues', []);
                            if (this.freeText && nextValue) {
                                // return the text from the autocomplete
                                dataModel.value = nextValue;
                            } else {
                                dataModel.value = null;
                            }
                        }
                        jsonUtils.setValue(dataModel, 'multipleSelect', false);
                        jsonUtils.setValue(dataModel, 'selectedIdx', matchValueIndex);
                    }

                    var report = new aria.widgets.controllers.reports.DropDownControllerReport();
                    if (!args.avoidChangingText) {
                        report.text = nextValue;
                        report.caretPosStart = args.caretPosStart;
                        report.caretPosEnd = args.caretPosEnd;
                    }

                    report.value = dataModel.value;
                    report.cancelKeyStroke = true;

                    if (error != null) {
                        report.ok = !error;
                    } else {
                        if (!this.freeText && suggestionsAvailable && !hasSuggestions) {
                            report.ok = false;
                            report.errorMessages.push(this.res.errors["40020_WIDGET_AUTOCOMPLETE_VALIDATION"]);
                        } else {
                            report.ok = true;
                        }
                    }
                    report.displayDropDown = hasSuggestions && triggerDropDown;
                    report.repositionDropDown = repositionDropDown || (this._isExpanded !== allSuggestions);
                    this._isExpanded = allSuggestions;
                    var arg = {};
                    arg.stopValueProp = true;
                    this._raiseReport(report, arg);
                    aria.templates.RefreshManager.resume();
                }
            }
1092022
function openSuggestions(oSF) {
		if (oSF.getEnableSuggestions()) {
			if (!oSF._oSuggest) {
				oSF._oSuggest = new Suggest(oSF);
			}
			oSF._oSuggest.open();
		}
	}
1155319
function(){
		console.log("Unknown Response");

		if (_pathConfirmationCounter < 3){
			console.log("Please enter a 'Y' or an 'N' when answering.\n");
			_pathConfirmationCounter++;
			confirmDestination();
		} else {
			console.log("Unable to install at this time due to too many unknown responses.\n");
			_prompt.close();
		}
	}
69843
private function package_prompt()
    {
        $question = new ChoiceQuestion(
            "\nPlease choose a package to publish:",
            Config::get('services.providers')
        );

        $question->setErrorMessage('[%s] is invalid.');

        return $this->helper->ask($this->input, $this->output, $question);
    }
1048908
function askForDockerPushCommand() {
    if (this.regenerate) return;

    const done = this.async();

    const prompts = [
        {
            type: 'input',
            name: 'dockerPushCommand',
            message: 'What command should we use for push Docker image to repository?',
            default: this.dockerPushCommand ? this.dockerPushCommand : 'docker push'
        }
    ];

    this.prompt(prompts).then(props => {
        this.dockerPushCommand = props.dockerPushCommand;
        done();
    });
}
958994
function init()
    {
        $this->add_js();

        $action = rcube_utils::get_input_value('_a', rcube_utils::INPUT_GPC);

        if ($this->rc->action == 'plugin.enigmakeys') {
            switch ($action) {
                case 'delete':
                    $this->key_delete();
                    break;
/*
                case 'edit':
                    $this->key_edit();
                    break;
*/
                case 'import':
                    $this->key_import();
                    break;

                case 'export':
                    $this->key_export();
                    break;

                case 'generate':
                    $this->key_generate();
                    break;

                case 'create':
                    $this->key_create();
                    break;

                case 'search':
                case 'list':
                    $this->key_list();
                    break;

                case 'info':
                    $this->key_info();
                    break;
            }

            $this->rc->output->add_handlers(array(
                    'keyslist'     => array($this, 'tpl_keys_list'),
                    'keyframe'     => array($this, 'tpl_key_frame'),
                    'countdisplay' => array($this, 'tpl_keys_rowcount'),
                    'searchform'   => array($this->rc->output, 'search_form'),
            ));

            $this->rc->output->set_pagetitle($this->enigma->gettext('enigmakeys'));
            $this->rc->output->send('enigma.keys');
        }
/*
        // Preferences UI
        else if ($this->rc->action == 'plugin.enigmacerts') {
            $this->rc->output->add_handlers(array(
                    'keyslist'     => array($this, 'tpl_certs_list'),
                    'keyframe'     => array($this, 'tpl_cert_frame'),
                    'countdisplay' => array($this, 'tpl_certs_rowcount'),
                    'searchform'   => array($this->rc->output, 'search_form'),
            ));

            $this->rc->output->set_pagetitle($this->enigma->gettext('enigmacerts'));
            $this->rc->output->send('enigma.certs'); 
        }
*/
        // Message composing UI
        else if ($this->rc->action == 'compose') {
            $this->compose_ui();
        }
    }
1242950
function (suggestions) {
                var selectedSuggestions = this.selectedSuggestions;
                var filteredSuggestions = [];
                for (var i = 0; i < suggestions.length; i++) {
                    var curSuggestion = suggestions[i];
                    if (this._findSuggestion(selectedSuggestions, curSuggestion) == -1) {
                        filteredSuggestions.push(curSuggestion);
                    }
                }
                return filteredSuggestions;
            }
1214895
function init(answers) {
  console.log(seperator);
  console.log(chalk.gray(`Setting up selected task runner: ${chalk.reset(answers.runner)}`));

  // Check if package.json exists
  try {
    fs.statSync(`./package.json`);
    packageJSONExists = true;

    console.log(chalk.green('package.json exists'));
    console.log(chalk.gray('Running npm install...'));
    
    // If package.json exists make sure all listed packages are installed
    execSync(`npm install ${squelch}`);
  } catch (err) {
    packageJSONExists = false;
    
    console.log(chalk.yellow('package.json does not exist'));
    console.log(chalk.gray('Creating package.json with default options...'));
    
    // If package.json does not exist then create a new, default one
    execSync(`npm init --force ${squelch}`);
  }

  // Install documentation packages
  configureDocumentation(answers);

  // Initialize the selected task runner
  runnerSetup[answers.runner].install(answers);
  
  // Compile the runner's template files
  runnerSetup[answers.runner].configure(answers.docs, config['gh-pages'].name);

  // Configure the custom git script
  configureGitAlias(answers, config['gh-pages'].name);
}
687020
function promptIfMainTheme(env) {
  return new Promise((resolve, reject) => {
    const c = config.shopify[env]

    if (!c.api_key) {
      console.log(chalk.yellow(`The "${env}" environment in config/shopify.yml does not specify an "api_key". Skipping check for if is main theme.`))
      resolve()
      return
    }

    // c.theme_id is live or equal to mainThemeId
    if (c.theme_id === 'live' || (mainThemeId && mainThemeId === c.theme_id)) {
      const question = 'You are about to deploy to the main theme. Continue ?'

      prompt(question, false).then((isYes) => {
        if (isYes) {
          resolve()
          return
        }

        reject('Aborting. You aborted the deploy.')
      })

      return
    }

    // we already have a mainThemeId and it's not c.theme_id
    if (mainThemeId && mainThemeId !== c.theme_id) {
      resolve()
      return
    }

    fetchMainThemeId(env)
      .then((id) => {
        mainThemeId = id
        promptIfMainTheme(env).then(resolve).catch(reject)
      })
      .catch(reject)
  })
}
1348197
function suggest (opts) {
  return new Promise(function (resolve) {
    if (!opts && !opts.term) {
      throw Error('term missing');
    }

    return resolve(BASE_URL + encodeURIComponent(opts.term));
  })
    .then(url => common.request(url, {}, opts.requestOptions))
    .then(parseXML)
    .then(extractSuggestions);
}
274829
function install(args, cb) {
  args = ['install', '--save-dev'].concat(args);
  utils.spawn('npm', args, {stdio: 'inherit'})
    .on('error', cb)
    .on('close', function(code, err) {
      cb(err, code);
    });
}
1086567
function (response) {
        var that = this,
            suggestions;

        if (!response || !$.isArray(response.suggestions)) {
            return false;
        }

        that.verifySuggestionsFormat(response.suggestions);
        that.setUnrestrictedValues(response.suggestions);

        if ($.isFunction(that.options.onSuggestionsFetch)) {
            suggestions = that.options.onSuggestionsFetch.call(that.element, response.suggestions);
            if ($.isArray(suggestions)) {
                response.suggestions = suggestions;
            }
        }

        return true;
    }