App-redisp

 view release on metacpan or  search on metacpan

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

}

sub run {
  my($self) = @_;

  my $short_server = $self->host =~ /[0-9]$/
    ? $self->host # IP address
    : ($self->host =~ /^([^.]+)/)[0];

  my $read = Term::ReadLine->new($short_server);
  my $prompt = "$short_server> ";

  while(1) {
    my $line = $read->readline($prompt);
    exit unless defined $line;
    $read->addhistory($line) if $line =~ /\S/;

    if($line =~ /^(?:\?|help)$/) {
      print <DATA>;
      next;
    } elsif($line =~ /^\.(\w+)(?:\s+(.*))?/) {
      ($util_cmds{$1} || sub { warn "Unknown command\n" })->($2);
      next;
    } elsif($line =~ /^\s*(\w+)/ && exists $redis_special_commands{$1}) {



( run in 0.828 second using v1.01-cache-2.11-cpan-6aa56a78535 )