App-Cleo-Patra
view release on metacpan or search on metacpan
lib/App/Cleo/Patra.pm view on Meta::CPAN
my $cmd = defined $commands[$i] ? $commands[$i] : die "no command $i";
chomp $cmd;
my $keep_going = $cmd =~ s/^\.\.\.//;
my $run_in_background = $cmd =~ s/^!!!//;
$self->do_cmd($cmd) and next CMD
if $run_in_background;
no warnings 'redundant';
my $prompt_state = $self->{state};
print sprintf $self->{$prompt_state}, $i;
my @steps = split /%%%/, $cmd;
while (my $step = shift @steps) {
my $should_pause = !($keep_going || $continue_to_end);
my $key = $should_pause ? ReadKey(0) : '';
if ($key =~ /^\d$/) {
$key .= $1 while (ReadKey(0) =~ /^(\d)/);
}
print "\n" if $key =~ m/^[srp]|[0-9]+/;
lib/App/Cleo/Patra.pm view on Meta::CPAN
=over 4
=item delay
Number of microseconds to wait before displaying each character of the command.
The default is C<25_000>.
=item ps1
String to use for the artificial prompt. The token C<%d> will be substituted
with the number of the current command. The default is C<(%d)$>.
=item ps2
String to use for the artificial prompt that appears for multiline commands. The
token C<%d> will be substituted with the number of the current command. The
default is C<< > >>.
=item shell
Path to the shell command that will be used to run the commands. Defaults to
either the C<SHELL> environment variable or C</bin/bash>.
=back
( run in 1.497 second using v1.01-cache-2.11-cpan-6aa56a78535 )