From: Andrew Ruthven Date: Sun, 4 Mar 2012 08:24:43 +0000 (+1300) Subject: Add oneliner-bullets option which inserts asterisk before each oneliner X-Git-Tag: debian-0.10.0-1~10 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2947a62073c2fcf37ceb3b518dc218436a880f2;p=mythtv-status.git Add oneliner-bullets option which inserts asterisk before each oneliner --- diff --git a/bin/mythtv-status b/bin/mythtv-status index 9d0d870..5647740 100755 --- a/bin/mythtv-status +++ b/bin/mythtv-status @@ -59,6 +59,11 @@ $c->{'guide_days_warn'} ||= 2; # How many days we require. $c->{'auto_expire_count'} ||= 10; # How many auto expire shows to display. $c->{'recording_in_warn'} ||= 60 * 60; # When is the next recording considered critical? (seconds) +# We allow a hack for MS Outlook which normally recognises the +# oneliners block as a paragraph and wraps it. If it sees "bullets" +# it believes it is a bulleted list and leaves it alone. +$c->{'oneliner_bullets'} ||= 0; + # What units we have available for converting diskspaces. # The threshold is at what level we switch to using that unit. my @size_thresholds = ( @@ -99,7 +104,8 @@ GetOptions( 'guide-days-warn=i' => \$c->{'guide_days_warn'}, 'auto-expire-count=i' => \$c->{'auto_expire_count'}, 'recording-in-warn=i' => \$c->{'recording_in_warn'}, - 'encoder-skip-idle!' => \$c->{'encoder_skip_idle'}, + 'encoder-skip-idle!' => \$c->{'encoder_skip_idle'}, + 'oneliner-bullets!' => \$c->{'oneliner_bullets'}, 'status!' => \$c->{'display'}{'Status'}, 'encoders!' => \$c->{'display'}{'Encoders'}, @@ -593,9 +599,13 @@ if (scalar(@oneliners) > 0) { } # Put the one liners together, with leading dots to the colon. + # We allow a hack for MS Outlook which normally recognises the + # oneliners block as a paragrap and wraps it. If it sees "bullets" + # it believes it is a bulleted list and leaves it alone. my $oneliners = ""; for $line (@oneliners) { - $oneliners .= "$line->[0]" + $oneliners .= ($c->{'oneliner_bullets'} ? '* ' : '' ) + . "$line->[0]" . ('.' x ($length - length($line->[0]))) . ": $line->[1]\n"; } @@ -1208,6 +1218,12 @@ Suppress displaying blocks of the output if they would normally be displayed. The port to use when connecting to MythTV, defaults to 6544. +=item B<--oneliner-bullets> + +Insert asterisks (*) before each of the oneliners to stop some +email clients from thinking the oneliner block is a paragraph and +trying to word wrap them. + =item B<--auto-expire> Display the shows due to auto expire (output is normally suppressed).