Skip to content

Commit

Permalink
Make "raw" option override "json-translate"
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Pion committed May 31, 2023
1 parent d20173f commit 564830d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Zonemaster/CLI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,10 @@ sub run {

# align values
$self->json( 1 ) if $self->json_stream;
$self->raw( 0 ) if $self->json_translate; # deprecated
$self->raw( 1 ) if ( not $self->json_translate and grep(/^--no-json[_-]translate$/, @{$self->ARGV}) ); # deprecated
if ( not grep {/^--raw$/ || /^--no-raw$/} @{$self->ARGV} ) {
$self->raw( 0 ) if $self->json_translate;
$self->raw( 1 ) if ( not $self->json_translate and grep(/^--no-json[_-]translate$/, @{$self->ARGV}) );
}

# Filehandle for diagnostics output
my $fh_diag = ( $self->json or $self->raw )
Expand Down

0 comments on commit 564830d

Please sign in to comment.