summaryrefslogtreecommitdiff
path: root/ftparchive/apt-ftparchive.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-11-08 20:44:44 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-11-09 21:45:55 +0100
commitd9e518c6f7dc0ad464495b586d1b8e115d54d41a (patch)
tree87db13413b5dde823a556e40f71632994d4f9650 /ftparchive/apt-ftparchive.cc
parentad7e0941b376d792911f240377094a2e78ca8756 (diff)
use the same code to detect quiet setting in all tools
Git-Dch: Ignore
Diffstat (limited to 'ftparchive/apt-ftparchive.cc')
-rw-r--r--ftparchive/apt-ftparchive.cc19
1 files changed, 5 insertions, 14 deletions
diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc
index 7d9af4178..adf1b6d73 100644
--- a/ftparchive/apt-ftparchive.cc
+++ b/ftparchive/apt-ftparchive.cc
@@ -20,6 +20,7 @@
#include <apt-pkg/fileutl.h>
#include <apt-private/private-cmndline.h>
+#include <apt-private/private-output.h>
#include <algorithm>
#include <climits>
@@ -42,11 +43,7 @@
#include <apti18n.h>
/*}}}*/
-using namespace std;
-ostream c0out(0);
-ostream c1out(0);
-ostream c2out(0);
-ofstream devnull("/dev/null");
+using namespace std;
unsigned Quiet = 0;
// struct PackageMap - List of all package files in the config file /*{{{*/
@@ -1064,16 +1061,10 @@ int main(int argc, const char *argv[])
CommandLine CmdL(Args,_config);
ParseCommandLine(CmdL, Cmds, Args, &_config, NULL, argc, argv, ShowHelp);
- // Setup the output streams
- c0out.rdbuf(clog.rdbuf());
- c1out.rdbuf(clog.rdbuf());
- c2out.rdbuf(clog.rdbuf());
+ _config->CndSet("quiet",0);
Quiet = _config->FindI("quiet",0);
- if (Quiet > 0)
- c0out.rdbuf(devnull.rdbuf());
- if (Quiet > 1)
- c1out.rdbuf(devnull.rdbuf());
-
+ InitOutput(clog.rdbuf());
+
// Match the operation
CmdL.DispatchArg(Cmds);