<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl -w
# This file was preprocessed, do not edit!


package Debconf::Element::Teletype::Boolean;
use strict;
use Debconf::Gettext;
use base qw(Debconf::Element);


sub show {
	my $this=shift;

	my $y=gettext("yes");
	my $n=gettext("no");

	$this-&gt;frontend-&gt;display($this-&gt;question-&gt;extended_description."\n");

	my $default='';
	$default=$this-&gt;question-&gt;value if defined $this-&gt;question-&gt;value;
	if ($default eq 'true') {
		$default=$y;
	}
	elsif ($default eq 'false') {
		$default=$n;
	}

	my $description=$this-&gt;question-&gt;description;
	if (Debconf::Config-&gt;terse eq 'false') {
		$description.=" [$y/$n]";
	}

	my $value='';

	while (1) {
		$_=$this-&gt;frontend-&gt;prompt(
			default =&gt; $default,
			completions =&gt; [$y, $n],
			prompt =&gt; $description,
			question =&gt; $this-&gt;question,
		);
		return unless defined $_;

		if (substr($y, 0, 1) ne substr($n, 0, 1)) {
			$y=substr($y, 0, 1);
			$n=substr($n, 0, 1);
		}
		if (/^\Q$y\E/i) {
			$value='true';
			last;
		}
		elsif (/^\Q$n\E/i) {
			$value='false';
			last;
		}

		if (/^y/i) {
			$value='true';
			last;
		}
		elsif (/^n/i) {
			$value='false';
			last;
		}
	}
	
	$this-&gt;frontend-&gt;display("\n");
	$this-&gt;value($value);
}


1
</pre></body></html>