Debian Codegraph @

Debconf/Element/Teletype/String.pm

raw
1 #!/usr/bin/perl
2
3 =head1 NAME
4
5 Debconf::Element::Teletype::String - string input field
6
7 =cut
8
9 package Debconf::Element::Teletype::String;
10 use warnings;
11 use strict;
12 use base qw(Debconf::Element);
13
14 =head1 DESCRIPTION
15
16 This is a string input field.
17
18 =cut
19
20 sub show {
21 my $this=shift;
22
23 # Display the question's long desc first.
24 $this->frontend->display(
25 $this->question->extended_description."\n");
26
27 my $default='';
28 $default=$this->question->value if defined $this->question->value;
29
30 # Prompt for input using the short description.
31 my $value=$this->frontend->prompt(
32 prompt => $this->question->description,
33 default => $default,
34 question => $this->question,
35 );
36 return unless defined $value;
37
38 $this->frontend->display("\n");
39 $this->value($value);
40 }
41
42 1