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

- fixed abstract

- improved help
- default datemode to monthly
parent 46b856bc
No related branches found
No related tags found
No related merge requests found
...@@ -10,23 +10,31 @@ use namespace::autoclean -except => qr{SLUB::LZA::TA::.*}; ...@@ -10,23 +10,31 @@ use namespace::autoclean -except => qr{SLUB::LZA::TA::.*};
# VERSION # VERSION
# ABSTRACT: search IEs module for ta-tool # ABSTRACT: report module for ta-tool
sub abstract {"print AIP reports about Archival Information System (AIS)";} sub abstract {"print AIP reports about Archival Information System (AIS)";}
my $base_cmd = "$0 report";
my $dummycmd = " "x length($base_cmd);
my $description=<<"DESCR"; my $description=<<"DESCR";
Ask an AIS for some statistics about AIPs. Ask an AIS for some statistics about AIPs.
Overview:
$base_cmd [--debug] [--daily| --weekly | --monthly | --yearly] [--workflow=WORKFLOW]
$dummycmd --version
$dummycmd --help
Examples: Examples:
* Report statistics of AIPs last month for workflow Kitodo * Report statistics of AIPs last month for workflow Kitodo
'$0 report --monthly --workflow Kitodo' '$base_cmd --monthly --workflow Kitodo'
* Report statistics of AIPs last year as RSV * Report statistics of AIPs last year
'$0 report --yearly' '$base_cmd --yearly'
A printable PDF version could be generated using ff. commands: A printable PDF version could be generated using ff. commands:
'$0 report | asciidoctor-pdf - > report.pdf' '$base_cmd | asciidoctor-pdf - > report.pdf'
HINT: If you want lists, use the 'search' command instead!
DESCR DESCR
...@@ -41,12 +49,12 @@ sub opt_spec { ...@@ -41,12 +49,12 @@ sub opt_spec {
one_of => [ one_of => [
[ 'daily|d' => 'report based on last day'], [ 'daily|d' => 'report based on last day'],
[ 'weekly|W' => 'report based on last week'], [ 'weekly|W' => 'report based on last week'],
[ 'monthly|m' => 'report based on last month' ], [ 'monthly|m' => 'report based on last month (default)' ],
[ 'yearly|y' => 'report based on last year' ], [ 'yearly|y' => 'report based on last year' ]
] ],
} },
], ],
[ 'workflow|w=s' => 'LZA internal workflow name'], [ 'workflow|w=s' => 'LZA internal workflow name (optional)'],
[], [],
[ 'help|h', 'print usage message and exit', { shortcircuit => 1 } ], [ 'help|h', 'print usage message and exit', { shortcircuit => 1 } ],
[ 'version|v', 'print version information', { shortcircuit => 1 } ], [ 'version|v', 'print version information', { shortcircuit => 1 } ],
...@@ -59,6 +67,7 @@ sub validate_args { ...@@ -59,6 +67,7 @@ sub validate_args {
my ($cyear, $cmonth, $cday) = Today(); my ($cyear, $cmonth, $cday) = Today();
my ($from_year, $from_month, $from_day); my ($from_year, $from_month, $from_day);
my ($to_year, $to_month, $to_day); my ($to_year, $to_month, $to_day);
if (!exists $opt->{datemode}) {$opt->{datemode}="monthly"; $opt->{monthly}=1;}
if (exists $opt->{daily}) { if (exists $opt->{daily}) {
($from_year, $from_month, $from_day) = Add_Delta_YMD($cyear, $cmonth, $cday, 0, 0, -1); ($from_year, $from_month, $from_day) = Add_Delta_YMD($cyear, $cmonth, $cday, 0, 0, -1);
($to_year, $to_month, $to_day) = ($from_year, $from_month, $from_day); ($to_year, $to_month, $to_day) = ($from_year, $from_month, $from_day);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment