From 6cbf7605a3bb6f5030d384fc5f28aad9655f4272 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Mon, 15 Oct 2007 08:36:38 +1300 Subject: [PATCH] Pull out the XML generated timestamp and allow one line output. --- bin/status.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/status.pl b/bin/status.pl index 237133a..9e0df9e 100755 --- a/bin/status.pl +++ b/bin/status.pl @@ -33,6 +33,15 @@ our $tomorrow = substr(ParseDate('tomorrow'), 0, 8); # The blocks of output which we might generate. my @blocks = ( + # Date/Time from server + { + 'name' => 'Status', + 'xpath' => "//Status", + 'attrs' => [ qw/time date/ ], + 'template' => "__date__, __time__", + 'format' => 'one line' + }, + # Info about the encoders. { 'name' => 'Encoders', @@ -85,7 +94,8 @@ for my $block (@blocks) { next if (scalar(@$items) == 0); - print "$block->{'name'}:\n"; + $block->{'format'} ||= 'multi line'; + print "$block->{'name'}:" . ($block->{'format'} eq 'one line' ? ' ' : "\n"); for my $item (@{ $items }) { my $template = $block->{'template'}; -- 2.30.2