FS#593 isatty(1) check for quickdep to increase usability
This commit is contained in:
parent
38e5f51b6a
commit
54dc911470
@ -754,11 +754,14 @@ void PrtGet::printDepends( bool simpleListing )
|
|||||||
|
|
||||||
const list<string>& deps = transaction.dependencies();
|
const list<string>& deps = transaction.dependencies();
|
||||||
if ( simpleListing ) {
|
if ( simpleListing ) {
|
||||||
|
/* check if stdout is a tty, for package exclusion via: prt-get install `prt-get quickdep foobar | grep -v ^gnome-` */
|
||||||
|
bool const tty = isatty(1);
|
||||||
if ( deps.size() > 0 ) {
|
if ( deps.size() > 0 ) {
|
||||||
list<string>::const_iterator it = deps.begin();
|
list<string>::const_iterator it = deps.begin();
|
||||||
for ( ; it != deps.end(); ++it ) {
|
|
||||||
cout << *it << " ";
|
for ( ; it != deps.end(); ++it )
|
||||||
}
|
cout << *it << (tty ? " " : "\n");
|
||||||
|
if (tty)
|
||||||
cout << endl;
|
cout << endl;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user