X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/a246f2dc8c6084d857edb2792ce6b37c794e3d69..1bc849af8f694ab80887bd0e9b94280f78771dbc:/apt-pkg/contrib/progress.cc diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc index 9a29c4b66..0f2218f3c 100644 --- a/apt-pkg/contrib/progress.cc +++ b/apt-pkg/contrib/progress.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: progress.cc,v 1.7 1998/09/07 05:28:38 jgg Exp $ +// $Id: progress.cc,v 1.8 1998/10/02 04:39:53 jgg Exp $ /* ###################################################################### OpProgress - Operation Progress @@ -13,6 +13,7 @@ #endif #include #include +#include #include /*}}}*/ @@ -108,6 +109,18 @@ bool OpProgress::CheckChange(float Interval) return true; } /*}}}*/ +// OpTextProgress::OpTextProgress - Constructor /*{{{*/ +// --------------------------------------------------------------------- +/* */ +OpTextProgress::OpTextProgress(Configuration &Config) : + NoUpdate(false), NoDisplay(false), LastLen(0) +{ + if (Config.FindI("quiet",0) >= 1) + NoUpdate = true; + if (Config.FindI("quiet",0) >= 2) + NoDisplay = true; +}; + /*}}}*/ // OpTextProgress::Done - Clean up the display /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -123,7 +136,13 @@ void OpTextProgress::Done() Write(S); cout << endl; OldOp = string(); - } + } + + if (NoUpdate == true && NoDisplay == false && OldOp.empty() == false) + { + OldOp = string(); + cout << endl; + } } /*}}}*/ // OpTextProgress::Update - Simple text spinner /*{{{*/ @@ -139,7 +158,14 @@ void OpTextProgress::Update() { if (MajorChange == false) return; - cout << Op << endl; + if (NoDisplay == false) + { + if (OldOp.empty() == false) + cout << endl; + OldOp = "a"; + cout << Op << "..." << flush; + } + return; }