Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates the ipv4 and ipv6 command line options #185

Merged
merged 4 commits into from
Jan 20, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lib/Zonemaster/CLI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,13 @@ sub run {
}

# These two must come after any profile from command line has been loaded
# to override the profile setting, but only if selected.
Zonemaster::Engine::Profile->effective->set( q{net.ipv4}, 0+$self->ipv4 ) if defined ($self->ipv4);
Zonemaster::Engine::Profile->effective->set( q{net.ipv6}, 0+$self->ipv6 ) if defined ($self->ipv6);
# to make any IPv4/IPv6 option override the profile setting.
if defined ($self->ipv4) {
Zonemaster::Engine::Profile->effective->set( q{net.ipv4}, 0+$self->ipv4 );
}
if defined ($self->ipv6) {
Zonemaster::Engine::Profile->effective->set( q{net.ipv6}, 0+$self->ipv6 );
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary trailing semicolon

And I think that the 0+ can be removed as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I think that the 0+ can be removed as well.

That's correct. It's in the contract of the Profile properties to always return the correct data type.

Copy link
Contributor Author

@matsduf matsduf Jan 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concerning "0+" I also looked at that, but I wanted to change as little as possible since this is a bug fix late in the cycle.

The trailing semicolon it not needed. When I started with Perl 1996 I think it was recommended, or maybe even mandatory in Perl 4, so I have a habit of writing them. It does not harm anything.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate the historical note :)



if ( $self->dump_profile ) {
Expand Down