X-Git-Url: http://git.shiar.nl/barcat.git/blobdiff_plain/9a0f5056e03159f5a58f23385e2995a54b83cbd8..d38e0ec883629db7a1b92f379840e7c409bf904e:/barcat diff --git a/barcat b/barcat index d4a8274..0ab19d9 100755 --- a/barcat +++ b/barcat @@ -81,7 +81,10 @@ GetOptions(\%opt, local $/ = undef; # slurp my $pod = readline *DATA; $pod =~ s/^=over\K/ 25/; # indent options list - $pod =~ s/^=item\ \N*\n\n\N*\n\K (?:(?:^=over.*?^=back\n)?(?!=)\N*\n)*/\n/g; + $pod =~ s{ + ^=item \h \N*\n\n \N*\n \K # first line + (?: (?: ^=over .*? ^=back\n )? (?!=) \N*\n )* + }{\n}g; # abbreviate options $pod =~ s/[.,](?=\n)//g; # trailing punctuation $pod =~ s/^=item\ \K(?=--)/____/g; # align long options # abbreviate indicators @@ -305,7 +308,7 @@ say $opt{palette} ? color(0) : '' if $opt{spark}; sub show_stat { if ($opt{hidemin} or $opt{hidemax}) { - printf '%s of ', sum(grep { length } + printf '%.8g of ', sum(grep { length } @values[$opt{hidemin} .. ($opt{hidemax} || @lines) - 1] ) // 0; }