X-Git-Url: http://git.shiar.net/barcat.git/blobdiff_plain/210b0302ce34abc10278b6db327be28d60de6dff..48a2e93f039145d144094a5cd0fdae12ae3cb5fa:/barcat diff --git a/barcat b/barcat index b6d2f4d..ae9fff1 100755 --- a/barcat +++ b/barcat @@ -79,16 +79,27 @@ GetOptions(\%opt, 'usage|h' => sub { local $/; my $pod = readline *DATA; - $pod =~ s/^=over\K/ 22/m; # indent options list + $pod =~ s/^=over\K/ 25/m; # indent options list $pod =~ s/^=item \N*\n\n\N*\n\K(?:(?:^=over.*?^=back\n)?(?!=)\N*\n)*/\n/msg; + $pod =~ s/[.,](?=\n)//g; # trailing punctuation + $pod =~ s/^=item \K(?=--)/____/gm; # align long options + # abbreviate indicators + $pod =~ s/\Q>.../s>/g; + $pod =~ s/<(?:number|count|seconds)>/N/g; + $pod =~ s//\Uchar$1/g; + $pod =~ s/\Q | /|/g; + $pod =~ s/(?/\U$1/g; # uppercase require Pod::Usage; - my $parser = Pod::Usage->new; + my $parser = Pod::Usage->new(USAGE_OPTIONS => { + -indent => 2, -width => 78, + }); $parser->select('SYNOPSIS', 'OPTIONS'); $parser->output_string(\my $contents); $parser->parse_string_document($pod); $contents =~ s/\n(?=\n\h)//msg; # strip space between items + $contents =~ s/^ \K____/ /gm; # nbsp substitute print $contents; exit; }, @@ -344,7 +355,7 @@ Force colored output of values and bar markers. Defaults on if output is a tty, disabled otherwise such as when piped or redirected. -=item -f, --field=(|) +=item -f, --field=( | ) Compare values after a given number of whitespace separators, or matching a regular expression. @@ -367,7 +378,7 @@ turning long numbers like I<12356789> into I<12.4M>. Also changes an exponent I<1.602176634e-19> to I<160.2z>. Short integers are aligned but kept without decimal point. -=item -t, --interval[=(|-)] +=item -t, --interval[=( | -)] Output partial progress every given number of seconds or input lines. An update can also be forced by sending a I alarm signal. @@ -440,7 +451,7 @@ In case of additional colors, the last is used for values equal to the maximum, the first for minima. If unspecified, these are green and red respectively (I<31 90 32>). -=item --spark[=] +=item --spark[=] Replace lines by I, single characters corresponding to input values.