Move action option into the getopt module

This commit is contained in:
Duncan Ferguson 2014-06-07 12:26:58 +01:00
parent 526cc24860
commit 1edf8088f9
3 changed files with 13 additions and 7 deletions

View file

@ -10,12 +10,7 @@ use App::ClusterSSH;
my $app = App::ClusterSSH->new();
$app->options->add_common_ssh_options;
# only works in ssh and rsh, not telnet or console
$app->add_option(
spec => 'action|a=s',
help => $app->loc("Run the command in each session, e.g. C<-a 'vi /etc/hosts'> to drop straight into a vi session."),
);
$app->add_common_session_options;
$app->add_option(
spec => 'freddo|z',

View file

@ -113,7 +113,6 @@ my @options_spec = (
'version|v',
'help|h|?',
'man|H',
'action|a=s',
'cluster-file|c=s',
'tag-file|r=s',
'config-file|C=s',

View file

@ -76,6 +76,18 @@ sub add_common_ssh_options {
return $self;
}
sub add_common_session_options {
my ( $self ) = @_;
$self->add_option(
spec => 'action|a=s',
help => $self->loc("Run the command in each session, e.g. C<-a 'vi /etc/hosts'> to drop straight into a vi session.");
);
return $self;
}
sub getopts {
my ($self) = @_;