202 208 214 220 226 227 228 229 230 231 159
)],
whites => [qw( 1;30 0;37 1;37 )],
202 208 214 220 226 227 228 229 230 231 159
)],
whites => [qw( 1;30 0;37 1;37 )],
- greys => [map {"38;5;$_"} 0, 232..255, 15],
+ grays => [map {"38;5;$_"} 0, 232..255, 15],
random => [map {"38;5;$_"} List::Util::shuffle(17..231)],
rainbow=> [map {"38;5;$_"}
196, # r
random => [map {"38;5;$_"} List::Util::shuffle(17..231)],
rainbow=> [map {"38;5;$_"}
196, # r
'${sum+; color(1); $_ .= " total in "}',
'${count#} values',
'${lines#; $_ = $_ != @order && " over $_ lines"}',
'${sum+; color(1); $_ .= " total in "}',
'${count#} values',
'${lines#; $_ = $_ != @order && " over $_ lines"}',
- sprintf(' (%s)', join ', ',
+ sprintf('${count: (%s)}', join ', ',
@order = sort { $b <=> $a } @order unless tied @order;
my $maxval = $opt{maxval} // (
$opt{hidemax} ? max grep { length } @values[$nr .. $limit] :
@order = sort { $b <=> $a } @order unless tied @order;
my $maxval = $opt{maxval} // (
$opt{hidemax} ? max grep { length } @values[$nr .. $limit] :
- my ($name, $cmd) = split /\s*;/, $1, 2;
+ my ($name, $op, $cmd) = split /\s*([;:])/, $1, 2;
my $format = $name =~ s/\+// || $name !~ s/\#// && $opt{reformat};
local $_ = $vars->{$name};
defined && do {
$_ = $opt{'value-format'}->($_) if $format;
my $format = $name =~ s/\+// || $name !~ s/\#// && $opt{reformat};
local $_ = $vars->{$name};
defined && do {
$_ = $opt{'value-format'}->($_) if $format;
Options:
-a, --[no-]ascii Restrict user interface to ASCII characters
-C, --[no-]color Force colored output of values and bar markers
Options:
-a, --[no-]ascii Restrict user interface to ASCII characters
-C, --[no-]color Force colored output of values and bar markers
-f, --field=([+]N|REGEXP)
Compare values after a given number of whitespace
separators
-f, --field=([+]N|REGEXP)
Compare values after a given number of whitespace
separators
Restrict user interface to ASCII characters,
replacing default UTF-8 by their closest approximation.
Input is always interpreted as UTF-8 and shown as is.
Restrict user interface to ASCII characters,
replacing default UTF-8 by their closest approximation.
Input is always interpreted as UTF-8 and shown as is.
Force colored output of values and bar markers.
Defaults on if output is a tty,
disabled otherwise such as when piped or redirected.
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=([+]<number> | <regexp>)
+=item B<-c>, B<--count>
+
+Omit repetitions and count the number of occurrences.
+Similar to piping input to C<sort | uniq -c>
+but keeping the order of first appearances.
+
+=item B<-f>, B<--field>=([B<+>]I<number> | I<regexp>)
Compare values after a given number of whitespace separators,
or matching a regular expression.
Compare values after a given number of whitespace separators,
or matching a regular expression.
-Unspecified or I<-f0> means values are at the start of each line.
-With I<-f1> the second word is taken instead.
+Unspecified or B<-f0> means values are at the start of each line.
+With B<-f1> the second word is taken instead.
-for example I<-f'(\d+)'> for the first digits anywhere.
-A shorthand for this is I<+0>, or I<+N> to find the Nth number.
+for example B<-f'(\d+)'> for the first digits anywhere.
+A shorthand for this is C<+0>, or C<+N> to find the Nth number.
-turning long numbers like I<12356789> into I<12.4M>.
-Also changes an exponent I<1.602176634e-19> to I<160.2z>.
+turning long numbers like C<12356789> into C<12.4M>.
+Also changes an exponent C<1.602176634e-19> to C<160.2z>.
Output partial progress every given number of seconds or input lines.
An update can also be forced by sending a I<SIGALRM> alarm signal.
Output partial progress every given number of seconds or input lines.
An update can also be forced by sending a I<SIGALRM> alarm signal.
Trim line contents (between number and bars)
to a maximum number of characters.
The exceeding part is replaced by an abbreviation sign,
Trim line contents (between number and bars)
to a maximum number of characters.
The exceeding part is replaced by an abbreviation sign,
-A single integer indicates the last line number (like C<head>),
-or first line counting from the bottom if negative (like C<tail>).
+A single integer indicates the last line number (like I<head>),
+or first line counting from the bottom if negative (like I<tail>).
A range consists of a starting line number followed by either
a dash C<-> to an optional end, or plus sign C<+> with count.
A range consists of a starting line number followed by either
a dash C<-> to an optional end, or plus sign C<+> with count.
All hidden input is still counted and analyzed for statistics,
but disregarded for padding and bar size.
All hidden input is still counted and analyzed for statistics,
but disregarded for padding and bar size.
-One standard deviation right of the mean is at about I<68.3v>.
-The default includes I<< >31.73v <68.27v >>
-to encompass all I<normal> results, or 68% of all entries, by B<< <--> >>.
+One standard deviation right of the mean is at about C<68.3v>.
+The default includes C<< >31.73v <68.27v >>
+to encompass all I<normal> results, or 68% of all entries, by I<< <--> >>.
Bars extend from 0 or the minimum value if lower,
to the largest value encountered.
These options can be set to customize this range.
Bars extend from 0 or the minimum value if lower,
to the largest value encountered.
These options can be set to customize this range.
-Can be any CSI escape, such as I<90> for default dark grey,
-or alternatively I<1;30> for bright black.
+Can be any CSI escape, such as C<90> for default dark gray,
+or alternatively C<1;30> for bright black.
In case of additional colors,
the last is used for values equal to the maximum, the first for minima.
In case of additional colors,
the last is used for values equal to the maximum, the first for minima.
-Predefined color schemes are named I<whites> and I<fire>,
-or I<greys> and I<fire256> for 256-color variants.
+A non-numeric name can refer to a predefined color scheme:
+
+=over 8
+
+=item B<whites>
+
+Minimal set of monochrome brightnesses.
+
+=item B<grays>
+
+Utilize the 24 grayscale ramp in 256-color terminals.
+
+=item B<fire>
Prefix a unicode character corresponding to each value.
The first specified character will be used for non-values,
the remaining sequence will be distributed over the range of values.
Unspecified, block fill glyphs U+2581-2588 will be used.
Prefix a unicode character corresponding to each value.
The first specified character will be used for non-values,
the remaining sequence will be distributed over the range of values.
Unspecified, block fill glyphs U+2581-2588 will be used.
+While processing (possibly a neverending pipe),
+intermediate results are also shown on signal I<SIGINFO> if available (control+t on BSDs)
+or I<SIGQUIT> otherwise (ctrl+\ on linux).
+
+=item B<-u>, B<--unmodified>
Do not reformat values, keeping leading whitespace.
Keep original value alignment, which may be significant in some programs.
Do not reformat values, keeping leading whitespace.
Keep original value alignment, which may be significant in some programs.
Override the maximum number of columns to use.
Appended graphics will extend to fill up the entire screen,
otherwise determined by the environment variable I<COLUMNS>
Override the maximum number of columns to use.
Appended graphics will extend to fill up the entire screen,
otherwise determined by the environment variable I<COLUMNS>
-Commonly used after counting, for example users on the current server:
-
- users | tr ' ' '\n' | sort | uniq -c | barcat
-
-Letter frequencies in text files:
+Commonly used after counting, eg letter frequencies in text files:
cat /usr/share/games/fortunes/*.u8 |
perl -CS -nE 'say for grep length, split /\PL*/, uc' |
sort | uniq -c | barcat
cat /usr/share/games/fortunes/*.u8 |
perl -CS -nE 'say for grep length, split /\PL*/, uc' |
sort | uniq -c | barcat