Archer
view release on metacpan or search on metacpan
lib/Archer/Shell.pm view on Meta::CPAN
project => $self->{context}->{project},
server => $host
}
)->run( $self->{context} );
}
sub callback {
my ( $self, $server, $cmd ) = @_;
Net::SSH::sshopen2( $server, *READER, *WRITER, $cmd );
while (<READER>) {
chomp;
print "[$server] $_\n";
}
close READER;
close WRITER;
}
sub help {
my ($self) = @_;
my $help = <<HELP;
To quit, just type quit, exit, or press ctrl-D.
This shell is still experimental.
execute a command on all servers, just type it directly, like:
archer> ping
To execute a command on a specific set of servers, specify an 'on' clause.
Note that if you specify more than one host name, they must be
space-delimited.
archer> on app1.foo.com app2.foo.com do ping
To execute a command on all servers matching a set of roles:
archer> with web db do ping
To execute an Archer task, prefix the name with a bang, by default it
will be executed only on the role applyed to this task.
archer> !restart
To execute an Archer task on a specific set of servers:
archer> !restart on app1.foo.com app2.foo.com
To execute an Archer task on all servers matching a set of roles:
archer> !restart with web db
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
=head1 SEE ALSO
L<Term::ReadLine>
=cut
( run in 0.946 second using v1.01-cache-2.11-cpan-0b5f733616e )