code: public static function confirm($question, $allowShort, $defaultValue = false)
      {
          $value = $defaultValue ? 'yes' : 'no';
          $value = self::ask($question . ' (yes/no)', $value);
          return $value == 'yes' || ($value == 'y' && $allowShort);
      }
docs: Confirm question.
  
  @param string $question
  @param boolean $allowShort Allow to use "y" / "n".
  @param boolean $defaultValue Default false.
  @return boolean