Skip to content

Commit

Permalink
Merge pull request #370 from tgreenx/remove-deprecated
Browse files Browse the repository at this point in the history
Remove planned deprecated '--sourceaddr' option
  • Loading branch information
tgreenx authored May 14, 2024
2 parents 53702ad + 77e4ea7 commit d9d6fce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 35 deletions.
26 changes: 2 additions & 24 deletions lib/Zonemaster/CLI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -275,26 +275,13 @@ has 'dump_profile' => (
documentation => __( 'Print the effective profile used in JSON format, then exit.' ),
);

has 'sourceaddr' => (
is => 'ro',
isa => 'Str',
required => 0,
documentation => __(
'Deprecated (planned removal: v2024.1). '
. 'Use --sourceaddr4 and/or --sourceaddr6. '
. 'Source IP address used to send queries. '
. 'Setting an IP address not correctly configured on a local network interface causes cryptic error messages.'
),
);

has 'sourceaddr4' => (
is => 'ro',
isa => 'Str',
required => 0,
documentation => __(
'Source IPv4 address used to send queries. '
. 'Setting an IPv4 address not correctly configured on a local network interface fails silently. '
. 'Can not be combined with --sourceaddr.'
. 'Setting an IPv4 address not correctly configured on a local network interface fails silently.'
),
);

Expand All @@ -304,8 +291,7 @@ has 'sourceaddr6' => (
required => 0,
documentation => __(
'Source IPv6 address used to send queries. '
. 'Setting an IPv6 address not correctly configured on a local network interface fails silently. '
. 'Can not be combined with --sourceaddr.'
. 'Setting an IPv6 address not correctly configured on a local network interface fails silently.'
),
);

Expand Down Expand Up @@ -353,14 +339,6 @@ sub run {
print_test_list();
}

if ( $self->sourceaddr ) {
if ( $self->sourceaddr4 or $self->sourceaddr6 ) {
die __( "Error: --sourceaddr can't be combined with --sourceaddr4 or --sourceaddr6." ) . "\n";
}
printf STDERR "%s\n\n", __( "Warning: --sourceaddr is deprecated (planned removal: v2024.1). Use --sourceaddr4 and/or --sourceaddr6 instead." );
Zonemaster::Engine::Profile->effective->set( q{resolver.source}, $self->sourceaddr );
}

if ( $self->sourceaddr4 ) {
Zonemaster::Engine::Profile->effective->set( q{resolver.source4}, $self->sourceaddr4 );
}
Expand Down
13 changes: 2 additions & 11 deletions script/zonemaster-cli
Original file line number Diff line number Diff line change
Expand Up @@ -256,26 +256,17 @@ name servers took to answer.

Print the effective profile used in JSON format, then exit.

=item --sourceaddr=IPADDR

Deprecated since v2023.1 (planned removal: v2024.1), use --sourceaddr4
and/or --sourceaddr6 instead.

Specify the source IP address used to send queries.
Setting an IP address not correctly configured on a local network interface
causes cryptic error messages.

=item --sourceaddr4=IPADDR

Specify the source IPv4 address used to send queries.
Setting an IPv4 address not correctly configured on a local network interface
fails silently. Can not be combined with --sourceaddr.
fails silently.

=item --sourceaddr6=IPADDR

Specify the source IPv6 address used to send queries.
Setting an IPv6 address not correctly configured on a local network interface
fails silently. Can not be combined with --sourceaddr.
fails silently.

=item --[no-]elapsed

Expand Down

0 comments on commit d9d6fce

Please sign in to comment.