Skip to content

Commit

Permalink
Print information on STDERR if --json has been selected (#84)
Browse files Browse the repository at this point in the history
* Print information on selected config or policy to STDERR if --json has been selected
* Added message to STDERR of loaded policy if policy file and dump policy have been selected.
* Added message to STDERR of loaded config if config file and dump config have been selected.
  • Loading branch information
matsduf authored Aug 17, 2018
1 parent 1919e10 commit 4e29dec
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 @@ -292,12 +292,14 @@ sub run {
}

if ( $self->policy ) {
say __( "Loading policy from " ) . $self->policy . '.' if not ($self->dump_config or $self->dump_policy);
say __( "Loading policy from " ) . $self->policy . '.' if not ($self->dump_config or $self->dump_policy or $self->json);
warn __( "Loading policy from " ) . $self->policy . ".\n" if $self->json or $self->dump_policy;
Zonemaster::Engine->config->load_policy_file( $self->policy );
}

if ( $self->config ) {
say __( "Loading configuration from " ) . $self->config . '.' if not ($self->dump_config or $self->dump_policy);
say __( "Loading configuration from " ) . $self->config . '.' if not ($self->dump_config or $self->dump_policy or $self->json);
warn __( "Loading configuration from " ) . $self->config . ".\n" if $self->json or $self->dump_config;
Zonemaster::Engine->config->load_config_file( $self->config );
}

Expand Down

0 comments on commit 4e29dec

Please sign in to comment.