From c0f36f30378ea6315768522940c275841150bd6a Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 12 Jul 2025 08:32:40 +0300 Subject: feat: Update HTML style to match foo.zone and add version switch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated HTML CSS to use minimalist foo.zone style with monospace font - Added --version switch showing v0.1.0 - Simplified styling with smaller headers and cleaner table presentation - Maximum width now 80ch for better readability 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- foostats.pl | 91 +++++++++++++++++++++++++++---------------------------------- 1 file changed, 40 insertions(+), 51 deletions(-) (limited to 'foostats.pl') diff --git a/foostats.pl b/foostats.pl index ae47344..7dbc26d 100644 --- a/foostats.pl +++ b/foostats.pl @@ -15,6 +15,8 @@ no warnings qw(experimental::refaliasing); # TODO: UNDO use diagnostics; +use constant VERSION => 'v0.1.0'; + # TODO: Blog post about this script and the new Perl features used. # TODO NEXT: # * Write out a nice output from each merged file, also merge if multiple hosts results @@ -925,73 +927,53 @@ package Foostats::Reporter { $title @@ -1533,6 +1515,7 @@ package main { Default: /var/log/fooodds --partner-node Hostname of the partner node for replication. Default: fishfinger.buetow.org or blowfish.buetow.org + --version Show version information. --help Show this help message. USAGE exit 0; @@ -1550,7 +1533,7 @@ package main { $out->write; } - my ( $parse_logs, $replicate, $report, $all, $help ); + my ( $parse_logs, $replicate, $report, $all, $help, $version ); # With default values my $stats_dir = '/var/www/htdocs/buetow.org/self/foostats'; @@ -1574,8 +1557,14 @@ package main { 'output-dir=s' => \$output_dir, 'html-output-dir=s' => \$html_output_dir, 'partner-node=s' => \$partner_node, + 'version' => \$version, 'help|?' => \$help; + if ($version) { + print "foostats " . VERSION . "\n"; + exit 0; + } + usage() if $help; parse_logs( $stats_dir, $odds_file, $odds_log ) -- cgit v1.2.3