Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Move --ns & --ds validation earlier in the code

Co-authored-by: tgreenx <96772376+tgreenx@users.noreply.github.com>
  • Loading branch information
MichaelTimbert and tgreenx committed Aug 28, 2024
1 parent faf2d5d commit c54551a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/Zonemaster/CLI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,14 @@ sub run {
die __( "--level must be one of CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG, DEBUG2 or DEBUG3.\n" );
}

if ( $self->ns and @{ $self->ns } > 0 ) {
$self->check_fake_delegation( $domain );
}

if ( $self->ds and @{ $self->ds } ) {
$self->check_fake_ds( $domain );
}

my $translator;
$translator = Zonemaster::Engine::Translator->new unless $self->raw;
$translator->locale( $self->locale ) if $translator and $self->locale;
Expand Down Expand Up @@ -640,14 +648,6 @@ sub run {
Zonemaster::Engine::Recursor->add_fake_addresses( '.', $hints_data );
}

if ( $self->ns and @{ $self->ns } > 0 ) {
$self->check_fake_delegation( $domain );
}

if ( $self->ds and @{ $self->ds } ) {
$self->check_fake_ds( $domain );
}

if ( $self->profile or $self->test ) {
# Separate initialization from main output in human readable output mode
print "\n" if $fh_diag eq *STDOUT;
Expand Down

0 comments on commit c54551a

Please sign in to comment.