public static function prompt( $text, $options = [] ) {
		$options = ArrayHelper::merge(
			[
				'required'  => false,
				'default'   => null,
				'pattern'   => null,
				'validator' => null,
				'error'     => 'Invalid input.',
			],
			$options
		);
		$error   = null;
		top:
		$input = $options['default']
			? static::input( "$text [" . $options['default'] . '] ' )
			: static::input( "$text " );
		if ( $input === '' ) {
			if ( isset( $options['default'] ) ) {
				$input = $options['default'];
			} else if ( $options['required'] ) {
				static::output( $options['error'] );
				goto top;
			}
		} else if ( $options['pattern'] && ! preg_match( $options['pattern'], $input ) ) {
			static::output( $options['error'] );
			goto top;
		} else if ( $options['validator'] &&
		            ! call_user_func_array( $options['validator'], [ $input, &$error ] )
		) {
			static::output( isset( $error ) ? $error : $options['error'] );
			goto top;
		}

		return $input;
	}