mirror of
https://github.com/duncs/clusterssh.git
synced 2025-04-21 09:09:06 +00:00
Fix using accessors names where the original option used hyphens
This commit is contained in:
parent
36d100d62d
commit
e6ed822a43
1 changed files with 7 additions and 4 deletions
|
@ -60,7 +60,9 @@ sub add_option {
|
|||
} else {
|
||||
$desc .= "--$item";
|
||||
$long = "--$item";
|
||||
$accessor=$item if(!$accessor);
|
||||
if(!$accessor) {
|
||||
$accessor=$item;
|
||||
}
|
||||
}
|
||||
$desc .= " $arg" if($arg);
|
||||
$short .= " $arg" if($short && $arg);
|
||||
|
@ -106,6 +108,7 @@ sub add_common_options {
|
|||
);
|
||||
$self->add_option(
|
||||
spec => 'generate-pod',
|
||||
no_accessor => 1,
|
||||
hidden => 1,
|
||||
);
|
||||
$self->add_option(
|
||||
|
@ -259,11 +262,11 @@ sub getopts {
|
|||
foreach my $option ( sort keys(%{ $self->{command_options}}) ) {
|
||||
my $accessor=$self->{command_options}->{$option}->{accessor};
|
||||
|
||||
if($accessor) {
|
||||
if(my $acc=$accessor) {
|
||||
$accessor =~ s/-/_/g;
|
||||
no strict 'refs';
|
||||
*$accessor = sub {
|
||||
return $options->{$accessor};
|
||||
return $options->{$acc};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -277,7 +280,7 @@ sub getopts {
|
|||
$self->debug(2, "Title: " . $self->title );
|
||||
}
|
||||
|
||||
if ( $options->{use_all_a_records} ) {
|
||||
if ( $self->use_all_a_records ) {
|
||||
$self->parent->config->{use_all_a_records}
|
||||
= !$self->parent->config->{use_all_a_records} || 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue