App-riap

 view release on metacpan or  search on metacpan

lib/App/riap.pm  view on Meta::CPAN

        #$attribs->{term_set} = ["", "", "", ""];
    }

    $o->{stop} = 0;
    $o->preloop;
    while (1) {
        my $line;
        {
            no warnings 'once';
            local $Signal::Safety = 0; # limit the use of unsafe signals
            $line = $o->readline($o->prompt_str);
        }
        last unless defined($line);
        my $time1 = time();
        $o->cmd($line);
        my $time2 = time();
        if ($o->setting('debug_time_command')) {
            say sprintf("  %.3fs", ($time2-$time1));
        }
        last if $o->{stop};
    }

lib/App/riap.pm  view on Meta::CPAN

        close $fh or die "Can't close history file $filename: $!\n";
    }
}

sub postloop {
    my $self = shift;
    print "\n";
    $self->save_history;
}

sub prompt_str {
    my $self = shift;
    join(
        "",
        $self->colorize("riap", "4169e1"), " ", # royal blue
        $self->colorize($self->state("pwd"), "2e8b57"), " ", # seagreen
        "> ",
    );
}

sub _riap_set_copts {

script/riap  view on Meta::CPAN


Whether to show how long a command takes.

=head2 cache_period => int (default: 300)

Number of seconds to cache Riap results from server, to speed up things like tab
completion.

=head1 FAQ

=head2 The prompt looks rather garbled (e.g. extra " m >" character)!

It looks to be an issue with L<Term::ReadLine::Perl>. Try installing
L<Term::ReadLine::Gnu> instead.

=head2 How do I redirect output to files?

B<riap> is meant to be a simple shell, not a full-blown Unix shell. Besides, a
syntax like this:

 riap> call /Package/Sub/somefunc > /path/to/file



( run in 0.717 second using v1.01-cache-2.11-cpan-0b5f733616e )