]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt.cc
policy: Return highest file pin if version pin == 0 in GetPriority()
[apt.git] / cmdline / apt.cc
index 5dbf868d79da83af354c9b5ea540c7453027b40d..2f7eddb611154adb5d97d0a26548aa4c433dd14d 100644 (file)
@@ -39,8 +39,7 @@
 
 static bool ShowHelp(CommandLine &)
 {
 
 static bool ShowHelp(CommandLine &)
 {
-   ioprintf(c1out,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
-           COMMON_ARCH,__DATE__,__TIME__);
+   ioprintf(c1out, "%s %s (%s)\n", PACKAGE, PACKAGE_VERSION, COMMON_ARCH);
 
    // FIXME: generate from CommandLine
    c1out << 
 
    // FIXME: generate from CommandLine
    c1out << 
@@ -70,7 +69,7 @@ int main(int argc, const char *argv[])                                        /*{{{*/
 {
    CommandLine::Dispatch Cmds[] = {
                                    // query
 {
    CommandLine::Dispatch Cmds[] = {
                                    // query
-                                   {"list",&List},
+                                   {"list",&DoList},
                                    {"search", &FullTextSearch},
                                    {"show", &APT::Cmd::ShowPackage},
 
                                    {"search", &FullTextSearch},
                                    {"show", &APT::Cmd::ShowPackage},
 
@@ -96,6 +95,10 @@ int main(int argc, const char *argv[])                                       /*{{{*/
 
    std::vector<CommandLine::Args> Args = getCommandArgs("apt", CommandLine::GetCommand(Cmds, argc, argv));
 
 
    std::vector<CommandLine::Args> Args = getCommandArgs("apt", CommandLine::GetCommand(Cmds, argc, argv));
 
+   // Init the signals
+   InitSignals();
+
+   // Init the output
    InitOutput();
 
    // Set up gettext support
    InitOutput();
 
    // Set up gettext support
@@ -109,20 +112,16 @@ int main(int argc, const char *argv[])                                    /*{{{*/
     }
 
     // some different defaults
     }
 
     // some different defaults
-   _config->CndSet("DPkgPM::Progress", "1");
+   _config->CndSet("DPkg::Progress-Fancy", "1");
    _config->CndSet("Apt::Color", "1");
    _config->CndSet("APT::Get::Upgrade-Allow-New", true);
    _config->CndSet("Apt::Color", "1");
    _config->CndSet("APT::Get::Upgrade-Allow-New", true);
+   _config->CndSet("APT::Cmd::Show-Update-Stats", true);
 
    // Parse the command line and initialize the package library
 
    // Parse the command line and initialize the package library
-   CommandLine CmdL(Args.data(), _config);
-   if (CmdL.Parse(argc, argv) == false ||
-       pkgInitSystem(*_config, _system) == false)
-   {
-      _error->DumpErrors();
-      return 100;
-   }
+   CommandLine CmdL;
+   ParseCommandLine(CmdL, Cmds, Args.data(), NULL, &_system, argc, argv, ShowHelp);
 
 
-   if(!isatty(STDOUT_FILENO) && 
+   if(!isatty(STDOUT_FILENO) &&
       _config->FindB("Apt::Cmd::Disable-Script-Warning", false) == false)
    {
       std::cerr << std::endl
       _config->FindB("Apt::Cmd::Disable-Script-Warning", false) == false)
    {
       std::cerr << std::endl
@@ -133,15 +132,6 @@ int main(int argc, const char *argv[])                                     /*{{{*/
                 << std::endl;
    }
 
                 << std::endl;
    }
 
-   // See if the help should be shown
-   if (_config->FindB("help") == true ||
-       _config->FindB("version") == true ||
-       CmdL.FileSize() == 0)
-   {
-      ShowHelp(CmdL);
-      return 0;
-   }
-
    // see if we are in simulate mode
    CheckSimulateMode(CmdL);
 
    // see if we are in simulate mode
    CheckSimulateMode(CmdL);