diff options
author | David Kalnischkies <david@kalnischkies.de> | 2014-11-08 20:44:44 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2014-11-09 21:45:55 +0100 |
commit | d9e518c6f7dc0ad464495b586d1b8e115d54d41a (patch) | |
tree | 87db13413b5dde823a556e40f71632994d4f9650 /cmdline/apt-mark.cc | |
parent | ad7e0941b376d792911f240377094a2e78ca8756 (diff) |
use the same code to detect quiet setting in all tools
Git-Dch: Ignore
Diffstat (limited to 'cmdline/apt-mark.cc')
-rw-r--r-- | cmdline/apt-mark.cc | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc index 487f3d8a1..2702dbbd3 100644 --- a/cmdline/apt-mark.cc +++ b/cmdline/apt-mark.cc @@ -22,6 +22,7 @@ #include <apt-pkg/pkgcache.h> #include <apt-private/private-cmndline.h> +#include <apt-private/private-output.h> #include <errno.h> #include <fcntl.h> @@ -41,10 +42,6 @@ /*}}}*/ using namespace std; -ostream c0out(0); -ostream c1out(0); -ostream c2out(0); -ofstream devnull("/dev/null"); /* DoAuto - mark packages as automatically/manually installed {{{*/ static bool DoAuto(CommandLine &CmdL) { @@ -444,18 +441,7 @@ int main(int argc,const char *argv[]) /*{{{*/ CommandLine CmdL; ParseCommandLine(CmdL, Cmds, Args.data(), &_config, &_system, argc, argv, ShowHelp); - // Deal with stdout not being a tty - if (!isatty(STDOUT_FILENO) && _config->FindI("quiet", -1) == -1) - _config->Set("quiet","1"); - - // Setup the output streams - c0out.rdbuf(cout.rdbuf()); - c1out.rdbuf(cout.rdbuf()); - c2out.rdbuf(cout.rdbuf()); - if (_config->FindI("quiet",0) > 0) - c0out.rdbuf(devnull.rdbuf()); - if (_config->FindI("quiet",0) > 1) - c1out.rdbuf(devnull.rdbuf()); + InitOutput(); // Match the operation CmdL.DispatchArg(Cmds); |