mirror of
https://github.com/duncs/clusterssh.git
synced 2025-07-03 09:53:23 +00:00
Move action option into the getopt module
This commit is contained in:
parent
526cc24860
commit
1edf8088f9
3 changed files with 13 additions and 7 deletions
|
@ -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',
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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) = @_;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue