blib/lib/App/Asciio/Text/Asciio/stripes/editable_exec_box.pm untested

filter: Statementstmt 0.0% 0 / 31 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 41 CC 3 SCAR 18.4
CC
3
Cov
0%
display_box_edit_dialog
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 6.3
1  
2 package App::Asciio::stripes::exec_box ;
3 use parent qw/App::Asciio::stripes::editable_box2/ ;
4  
5 use strict;
6 use warnings;
7  
8 use IO::Prompter;
9
10 #-----------------------------------------------------------------------------
11  
12 sub display_box_edit_dialog
13 {
14 my ($self, $title, $text) = @_ ;
15  
16 my $rows = $self->{BOX_TYPE} ;
17  
18 print "\e[2J\e[H\e[?25h" ;
19  
20 my $input = prompt "new title: ", -default => $title ;
21 if($input)
22 {
23 $input =~ s/\r$// ;
24 $input =~ s/\\n/\n/g ;
25 $title = "$input" ;
26 }
27 else
28 {
29 $title = undef ;
30 }
31  
32 my $title_separator = $self->{BOX_TYPE}[1] ;
33 $title_separator->[0] = prompt "title_sepearator [y/n]: ", -y1 ;
34  
35 $input = prompt "new command: ", -default => $text ;
36 if($input)
37 {$input =~ s/\r$// ;
38 $input =~ s/\\n/\n/g ;
39 $text = "$input" ;
40 }
41 else
42 {
43 $text = undef ;
44 }
45  
46 print "\e[?25l" ; # hide cursor
47  
48 return($text, $title) ;
49 }
50  
51 #-----------------------------------------------------------------------------
52  
53 1 ;