Skip to content
Snippets Groups Projects
Commit 97a6746c authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- added checks, fixes...

- added checks, fixes #20
parent aa8f603f
Branches
Tags
No related merge requests found
Pipeline #10583 failed
...@@ -33,9 +33,18 @@ sub validate_args { ...@@ -33,9 +33,18 @@ sub validate_args {
return 1; return 1;
} }
sub _warn_if_no_config {
foreach my $key (@_) {
warn "Missed configuration for $key, missed initalization via command 'init' or missed command line options!" unless defined $key;
}
return;
}
sub execute { sub execute {
my ($self, $opt, $args) = @_; my ($self, $opt, $args) = @_;
warn "This module needs further work, only '--target-version' and '--version' supported yet" unless defined $opt->{target_version} or defined $opt->{version};
if ($opt->{target_version}) { if ($opt->{target_version}) {
_warn_if_no_config(qw(elasticsearch_protocol elasticsearch_host elasticsearch_port));
say SLUB::LZA::TA::Archivematica::Elasticsearch::version_elasticsearch( say SLUB::LZA::TA::Archivematica::Elasticsearch::version_elasticsearch(
$SLUB::LZA::TA::config{elasticsearch_protocol}, $SLUB::LZA::TA::config{elasticsearch_protocol},
$SLUB::LZA::TA::config{elasticsearch_host}, $SLUB::LZA::TA::config{elasticsearch_host},
...@@ -43,8 +52,10 @@ sub execute { ...@@ -43,8 +52,10 @@ sub execute {
); );
} }
if ($opt->{version}) { if ($opt->{version}) {
say $SLUB::LZA::TA::VERSION; warn "Missed version for Module SLUB::LZA::TA, called from development directory without dzil-based release?" unless defined $SLUB::LZA::TA::VERSION;
say $SLUB::LZA::TA::VERSION if defined $SLUB::LZA::TA::VERSION;
} }
return 1; return 1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment