Ask string param from stdin php input
@param string $question
@param string|null $default
@return string
342755
public function ask($question, $default = null)
    {
        $que = new Question($question, $default);
        $helper = new SymfonyQuestionHelper();
        return $helper->ask($this->input, $this->output, $que);
    }
966337
private function getQuestionString(InputOption $option, $default)
    {
        if ('' !== (string) $default) {
            if (stripos($option->getName(), 'password') !== false) {
                return sprintf('%s? [<options=bold>HIDDEN</>]: ', $option->getDescription(), $default);
            }

            return sprintf('%s? [<options=bold>%s</>]: ', $option->getDescription(), $default);
        }

        return sprintf('%s?: ', $option->getDescription());
    }
798533
def _ask(question, default=None, data_type='str', show_hint=False):
    """"""

    data = default

    if data_type == 'bool':
        data = None
        default_string = "Y" if default else "N"

        while data not in ('Y', 'J', 'N', '1', '0'):
            data = input("%s? [%s]: " % (question, default_string)).upper()

            if data == '':
                return default

        return data in ('Y', 'J', '1')

    elif data_type in ('str', 'unicode'):
        if show_hint:
            msg = "%s? [%s] (%s): " % (question, default, data_type)
        else:
            msg = question

        data = input(msg)

        if len(data) == 0:
            data = default
    elif data_type == 'int':
        if show_hint:
            msg = "%s? [%s] (%s): " % (question, default, data_type)
        else:
            msg = question

        data = input(msg)

        if len(data) == 0:
            data = int(default)
        else:
            data = int(data)

    return data
976140
protected function confirm(string $question, string $default = 'n')
	{
		return (new Confirmation($this->input, $this->output))->ask($question, $default);
	}
800448
public function askWithCompletion($question, array $choices, $default = null)
    {
        $helper = $this->getHelperSet()->get('question');

        $question = new Question("<question>$question</question> ", $default);

        $question->setAutocompleterValues($choices);

        return $helper->ask($this->input, $this->output, $question);
    }
364033
private function getQuestion($question, $default = null, callable $validator = null, array $values = null)
    {
        $question = new Question(
            sprintf('<info>%s</info>%s: ', $question, $default ? sprintf(' [<comment>%s</comment>]', $default) : ''),
            $default
        );

        $question
            ->setValidator($validator)
            ->setAutocompleterValues($values);

        return $question;
    }
129295
public function ask($question)
    {
        //Show required message
        echo "\n";
        echo "\t", $this->colorize($question, 'info');
        echo "\n";
        //Get user input
        echo "\t"; $response = trim(fgets(STDIN));

        return $response;
    }
553052
public function askWithCompletion($question, array $choices, $default = null, $attempts = null, $strict = null)
    {
        return $this->output->askWithCompletion($question, $choices, $default, $attempts, $strict);
    }
1280203
public function choice($question, array $choices, $default = null, $attempts = null, $multiple = null)
    {
        $helper = $this->getHelperSet()->get('question');

        $question = new ChoiceQuestion("<question>$question</question> ", $choices, $default);

        $question->setMaxAttempts($attempts)->setMultiselect($multiple);

        return $helper->ask($this->input, $this->output, $question);
    }
735453
public function getFormattedQuestion($question, $default, array $options)
    {
        if ($this->isList($options)) {
            /**
             * Options list mode
             */
            return $this->getFormattedListQuestion($question, $default, $options);
        } else {
            /**
             * Simple options mode
             */
            return $this->getFormattedSimpleQuestion($question, $default, $options);
        }
    }
890116
private function askConfirmation(InputInterface $input, OutputInterface $output, $question, $default = true)
    {
        if ($this->getHelperSet()->has('question')) {
            $question = new ConfirmationQuestion($question, $default);

            return $this->getHelper('question')->ask($input, $output, $question);
        }

        return $this->getHelper('dialog')->askConfirmation($output, $question, $default);
    }
1374719
public function prompt($question, $default = null, $marker = ': ')
    {
        if (isset($default) && strpos($question, '[') === false) {
            $question .= ' [default: ' . $default . ']';
        }

        $this->out($question . $marker);

        $input = $this->in();

        if ($input === '') {
            return $default;
        }

        return $input;
    }
103770
private function prompt( $question, $default ) {

		$question .= ': ';
		if ( function_exists( 'readline' ) ) {
			return readline( $question );
		}

		echo $question;

		$ret = stream_get_line( STDIN, 1024, "\n" );
		if ( Utils\is_windows() && "\r" === substr( $ret, -1 ) ) {
			$ret = substr( $ret, 0, -1 );
		}
		return $ret;
	}
44132
def ask(self, question, default=False):
        
        choices = '[%s/%s]' % ('Y' if default else 'y', 'n' if default else 'N')
        while True:
            response = raw_input('%s %s' % (question, choices)).strip()
            if not response:
                return default
            elif response in 'yYoO':
                return True
            elif response in 'nN':
                return False
372508
protected function getFormattedListQuestion($question, $default, array $options)
    {
        $list = '';
        foreach ($options as $key => $title) {
            $list .= "  $key - $title".($default == $key ? ' (Default)' : '').PHP_EOL;
        }

        return $question.":\n".$list;
    }
1295360
public function ask(string $question, $default = null)
	{
		$this->output->write(trim($question) . ' ');

		$answer = $this->input->read();

		return empty($answer) ? $default : $answer;
	}
825509
public function askQuestion($message, $default = null)
    {
        $question = new Question($this->formatMessage($message, $default), $default);
        
        return $this->question->ask($this->input, $this->output, $question);
    }