summaryrefslogtreecommitdiffstats
path: root/lib/Reply/Plugin/ReadLine.pm
blob: dc9c617e8824962bfcf7cc4343243ec7d10b8b87 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package Reply::Plugin::ReadLine;
use strict;
use warnings;

use base 'Reply::Plugin';

use Term::ReadLine;

sub new {
    my $class = shift;

    my $self = $class->SUPER::new(@_);
    $self->{term} = Term::ReadLine->new('Reply');

    return $self;
}

sub read_line {
    my $self = shift;
    my ($next, $prompt) = @_;

    return $self->{term}->readline($prompt);
}

1;