diff options
| author | Paul Buetow <paul@buetow.org> | 2024-12-15 20:48:52 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-12-15 20:48:52 +0200 |
| commit | adbb2193132ce3505abf05b7c944717fbfd46c91 (patch) | |
| tree | 895c54a64d31ecfa36448d6c918d5a22c1468ff2 | |
| parent | fab0ce8907bc8d980725f613eb43502e244f04b0 (diff) | |
a bit less boilerplate
| -rw-r--r-- | foostats.pl | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/foostats.pl b/foostats.pl index 032b847..eb1ca74 100644 --- a/foostats.pl +++ b/foostats.pl @@ -418,12 +418,6 @@ package main { $out->write; } - sub replicate ($stats_dir, $partner_node) { - Foostats::Replicator->new(stats_dir => $stats_dir)->replicate($partner_node); - } - - sub report () { say 'report not yet implemented' } - my ($parse_logs, $replicate, $report, $all); # With default values @@ -439,6 +433,9 @@ package main { 'partner-node' => \$partner_node; parse_logs $stats_dir if $parse_logs or $all; - replicate $stats_dir, $partner_node if $replicate or $all; - report $stats_dir if $report or $all; + + Foostats::Replicator->new(stats_dir => $stats_dir)->replicate($partner_node) + if $replicate or $all; + + die 'report not yet implemented' if $report or $all; } |
