I took a stab at adding a configuration option for one-package-per-line
output. I'm not sure if adding a configuration option is the best way to
(though it certainly works for me), and I imagine the documentation also
needs to be updated if this is accepted.
Description: Add CmdLine::One-Per-Line configuration option
Added a configuration option for forcing aptitude 'package list' output
to be one-package-per-line. Defaults to OFF.
Author: Tim Gokcen <hexe...@gmail.com>
Bug-Debian: http://bugs.debian.org/540081
Bug-Debian: http://bugs.debian.org/319575
--- aptitude-0.6.8.2.orig/src/cmdline/cmdline_util.cc
+++ aptitude-0.6.8.2/src/cmdline/cmdline_util.cc
@@ -119,21 +119,32 @@ void cmdline_show_stringlist(strvector &
int loc=2;
- printf(" ");
-
- for(strvector::iterator i=items.begin(); i!=items.end(); ++i)
+ const bool onePerLine = aptcfg->FindB(PACKAGE "::CmdLine::One-Per-Line", false);
+ if (!onePerLine)
{
- if(loc + i->size() > (unsigned)(screen_width - 5))
- {
- printf("\n ");
- loc=2;
- }
+ printf(" ");
- printf("%s ", i->c_str());
- loc+=i->size()+1;
- }
+ for(strvector::iterator i=items.begin(); i!=items.end(); ++i)
+ {
+ if(loc + i->size() > (unsigned)(screen_width - 5))
+ {
+ printf("\n ");
+ loc=2;
+ }
+
+ printf("%s ", i->c_str());
+ loc+=i->size()+1;
+ }
- printf("\n");
+ printf("\n");
+ }
+ else
+ {
+ for(strvector::iterator i=items.begin(); i!=items.end(); ++i)
+ {
+ printf(" %s\n", i->c_str());
+ }
+ }
}
void cmdline_show_pkglist(pkgvector &items,