]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt.cc
new quiet level -qq for apt to hide progress output
[apt.git] / cmdline / apt.cc
index 98e715625f00eaddcd260cc547389c7792d096fc..eb16b561c36cd5cb79b14630712409d92227cbeb 100644 (file)
 
 static bool ShowHelp(CommandLine &, CommandLine::DispatchWithHelp const * Cmds)
 {
-   ioprintf(c1out, "%s %s (%s)\n", PACKAGE, PACKAGE_VERSION, COMMON_ARCH);
+   ioprintf(std::cout, "%s %s (%s)\n", PACKAGE, PACKAGE_VERSION, COMMON_ARCH);
 
    // FIXME: generate from CommandLine
-   c1out <<
+   std::cout <<
     _("Usage: apt [options] command\n"
       "\n"
       "CLI for apt.\n")
@@ -87,13 +87,19 @@ int main(int argc, const char *argv[])                                      /*{{{*/
       {nullptr, nullptr, nullptr}
    };
 
-   // FIXME: Those ignore commandline configuration like -q
-   InitSignals();
-   InitOutput();
-
    CommandLine CmdL;
    ParseCommandLine(CmdL, Cmds, "apt", &_config, &_system, argc, argv, ShowHelp);
 
+   int const quiet = _config->FindI("quiet", 0);
+   if (quiet == 2)
+   {
+      _config->CndSet("quiet::NoProgress", true);
+      _config->Set("quiet", 1);
+   }
+
+   InitSignals();
+   InitOutput();
+
    CheckIfCalledByScript(argc, argv);
    CheckIfSimulateMode(CmdL);