Re: Feedback for apt-history-curses-ui
Hi.
On Wed, Sep 09, 2015 at 08:51:30PM +0200, Javier Barroso wrote:
> > 8) This part's 'grep .' meaning currently escapes me:
> >
> > open my $grep_status, "grep-status -n -FPackage '' ".
> > " -s Package -s Architecture".
> > " -s Version -s Status -n |".
> > "grep . |";
> >
> That is to erase "^$" lines, so I can play with module (%) operator
Oh, I see. I'd use "grep -v '^$'" for clarity, but they don't argue
about tastes :)
> > 10) The case of terminal with less than 15 lines is not handled at all.
> >
> mmm I'm not sure how to handle it
This:
my $packages_list = $win->add(
"packages_list",
"Listbox",
-values => [@packages],
-onselchange => \&update_history,
-height => ${ENV{LINES}}-15,
-title => "Packages (".scalar @packages.")",
-border => "true",
-vscrollbar => "true",
) || die ($!);
Since you're using $LINES explicitly, you might as well check it's
defined, has a numeric value, and a value is greater-or-equal 16.
Or scrap $LINES altogether and use an appropriate function from
Term-Size or Term-Size-Perl.
> Thank you very much!
You're welcome.
Reco
Reply to: