public function getAnswer(InputInterface $input, OutputInterface $output, Question $question, $argument_name, $type = 'argument', $required = FALSE)
    {
        $helper = $this->getHelper('question');

        if ($type == 'argument') {
            $value = $input->getArgument($argument_name);
        } elseif ($type == 'option') {
            $value = $input->getOption($argument_name);
        }

        if (empty($value)) {

            // If we are in non-interactive mode, we have no choice but to return nothing.
            if ($input->getOption('yes')) {
                return '';
            }
            if ($required) {
                while (empty($value)) {
                    $value = $helper->ask($input, $output, $question);
                }
            }
            else {
                $value = $helper->ask($input, $output, $question);
            }
        }

        return $value;
    }