diff --git a/lib/SLUB/LZA/TA/Command/count.pm b/lib/SLUB/LZA/TA/Command/count.pm index e23db398e0b9433c745ef1aee591c3a27d89598b..f81fba5480b5a924e18ecc2e2d8f58c909f06e24 100644 --- a/lib/SLUB/LZA/TA/Command/count.pm +++ b/lib/SLUB/LZA/TA/Command/count.pm @@ -31,7 +31,8 @@ sub description { return "$description" } sub opt_spec { - return( + my @global_opts= SLUB::LZA::TA::common_global_opt_spec(); + my @local_opts = ( #["source|s=s" => "count based on string search in source metadata"], ["aip|a=s" => "count AIPs by given AIP id"], [ 'datemode' => hidden => { @@ -60,15 +61,11 @@ sub opt_spec { [ 'only-ldp', 'only if AIP is LDP funded' ], [ 'no-ldp', 'only if AIP is not LDP funded' ], ] } ], - [], - [], - [ 'help|h', 'print usage message and exit', { shortcircuit => 1 } ], - [ 'version|v', 'print version information', { shortcircuit => 1 } ], ); + return (@global_opts, [], @local_opts); } sub validate_args { my ($self, $opt, $args) = @_; - SLUB::LZA::TA::validate_global(@_); # no args allowed but options! $self->usage_error("No args allowed") if @$args; if (exists $opt->{creationdate}) { diff --git a/lib/SLUB/LZA/TA/Command/report.pm b/lib/SLUB/LZA/TA/Command/report.pm index 2424ea263ce40000f5a65fd5113f52867966dd97..c27457aceed6dd52a56f25cca95c6dd998309eca 100644 --- a/lib/SLUB/LZA/TA/Command/report.pm +++ b/lib/SLUB/LZA/TA/Command/report.pm @@ -42,7 +42,8 @@ sub description { return "$description" } sub opt_spec { - return ( + my @global_opts= SLUB::LZA::TA::common_global_opt_spec(); + my @local_opts = ( [ 'datemode' => hidden => { one_of => [ [ 'daily|d' => 'report based on last day'], @@ -68,9 +69,8 @@ sub opt_spec { [ 'with-ldp|l' => 'report with LDP'], [ 'workflow|w=s' => 'LZA internal workflow name (optional)'], [], - [ 'help|h', 'print usage message and exit', { shortcircuit => 1 } ], - [ 'version|v', 'print version information', { shortcircuit => 1 } ], ); + return (@global_opts, [], @local_opts); } sub validate_args { my ($self, $opt, $args) = @_; diff --git a/lib/SLUB/LZA/TA/Command/search.pm b/lib/SLUB/LZA/TA/Command/search.pm index 6ae5f9098b9a208c570fec0266ac14596ca8ecaa..9d0baae40dd69244f3967254b3b2412b2fbe1696 100644 --- a/lib/SLUB/LZA/TA/Command/search.pm +++ b/lib/SLUB/LZA/TA/Command/search.pm @@ -45,7 +45,8 @@ sub description { return "$description" } sub opt_spec { - return ( + my @global_opts= SLUB::LZA::TA::common_global_opt_spec(); + my @local_opts = ( [ 'output-format' => hidden => { one_of => [ [ 'output-as-csv|C' => 'prints output as Comma Separated Values (CSV)' ], @@ -114,17 +115,13 @@ sub opt_spec { [ 'with-slubarchiv-sipversion' => 'also returns AIP slubarchiv-sipversion'], [ 'with-status' => 'also returns AIP state in AIS' ], [ 'with-title' => 'also returns AIP title' ], - [], - [ 'help|h', 'print usage message and exit', { shortcircuit => 1 } ], - [ 'version|v', 'print version information', { shortcircuit => 1 } ], ); + return (@global_opts, [], @local_opts); } sub validate_args { my ($self, $opt, $args) = @_; - # no args allowed but options! $self->usage_error("No args allowed") if @$args; - SLUB::LZA::TA::validate_global(@_); if (exists $opt->{creationdate}) { if ($opt->{creationdate} =~ m/^(\d{4})-(\d{2})-(\d{2})$/ ) { my $from_epoch = Date_to_Time($1, $2, $3, 0, 0, 0); @@ -208,13 +205,12 @@ sub execute { $SLUB::LZA::TA::config{elasticsearch_protocol}, $SLUB::LZA::TA::config{elasticsearch_host}, $SLUB::LZA::TA::config{elasticsearch_port}, - 'aips', # indexname + 'aips', # indexname $aips_query, # query_hash ref ); #p($aips_response); SLUB::LZA::TA::Output::print_results($aips_response, $opt); return 1; - } 1;