From: Andrew Ruthven Date: Sun, 14 Oct 2007 19:36:38 +0000 (+1300) Subject: Pull out the XML generated timestamp and allow one line output. X-Git-Tag: 0.1~10 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cbf7605a3bb6f5030d384fc5f28aad9655f4272;p=mythtv-status.git Pull out the XML generated timestamp and allow one line output. --- 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'};