Archer
view release on metacpan or search on metacpan
lib/Archer/Plugin/Confirm.pm view on Meta::CPAN
package Archer::Plugin::Confirm;
use strict;
use warnings;
use base qw/Archer::Plugin/;
use IO::Prompt::Simple qw/prompt/;
sub run {
my ($self,) = @_;
local $SIG{ALRM} = sub {
$self->detach("\n\nConfirm timeout\n");
};
my $msg = $self->{config}->{msg} || 'do ? [y/n]';
my $timeout = $self->{config}->{timeout} || 0;
my $latest_alarm = alarm $timeout;
if ( lc(prompt( $msg )) =~ /\Ay(?:es)?\z/ms ) {
alarm $latest_alarm;
$self->log(debug => "yes");
}
else {
$self->log(debug => "no");
$self->detach("cancel'd by user");
}
}
1;
lib/Archer/Shell.pm view on Meta::CPAN
HELP
print $help;
}
1;
__END__
=head1 NAME
Archer::Shell - display shell prompt for remote servers.
=head1 DESCRIPTION
Shell prompt for remote servers.
=head1 FILES
~/.archer_shell_history
=head1 AUTHORS
Gosuke Miyashita
Tokuhiro Matsuno
( run in 0.583 second using v1.01-cache-2.11-cpan-0b5f733616e )