Fix scrolling header for --group-by=all.

This commit is contained in:
Daniel Nichter
2012-05-10 14:06:52 -07:00
parent 7fc8a3e989
commit 5a77e8c09c
9 changed files with 43 additions and 437 deletions

View File

@@ -2390,9 +2390,7 @@ sub print_deltas {
$Diskstats::printed_lines--;
}
if ( $self->automatic_headers()
&& $Diskstats::printed_lines <= @stats
&& !$self->isa("DiskstatsGroupByAll") ) {
if ( $self->automatic_headers() && $Diskstats::printed_lines <= @stats ) {
$self->force_print_header( $header, "#ts", "device" );
}
else {
@@ -2491,19 +2489,17 @@ sub group_by {
$self->clear_state() unless $self->interactive();
my $header_callback = $args{header_callback}
|| sub {
my ($self, @args) = @_;
$self->print_header(@args);
$self->{_print_header} = 0;
};
$self->parse_from(
filehandle => $args{filehandle},
filename => $args{filename},
data => $args{data},
sample_callback => sub {
$self->print_deltas(
header_callback => $header_callback,
header_callback => $args{header_callback} || sub {
my ($self, @args) = @_;
$self->print_header(@args);
$self->set_force_header(undef);
},
rows_callback => $args{rows_callback},
);
},