]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-get.cc
move apts cmdline helper type into -private
[apt.git] / cmdline / apt-get.cc
index 2a19360c8b6b74db81ca7b9829abb17211dfc5e3..69b12b2c7dedf3883445c72b88f4d10bd93157ea 100644 (file)
@@ -1526,10 +1526,7 @@ static bool DoIndexTargets(CommandLine &CmdL)
    return true;
 }
                                                                        /*}}}*/
-// ShowHelp - Show a help screen                                       /*{{{*/
-// ---------------------------------------------------------------------
-/* */
-static bool ShowHelp(CommandLine &, CommandLine::DispatchWithHelp const * Cmds)
+bool ShowHelp(CommandLine &, aptDispatchWithHelp const * Cmds)         /*{{{*/
 {
    ioprintf(cout, "%s %s (%s)\n", PACKAGE, PACKAGE_VERSION, COMMON_ARCH);
 
@@ -1613,11 +1610,9 @@ static bool ShowHelp(CommandLine &, CommandLine::DispatchWithHelp const * Cmds)
    return true;
 }
                                                                        /*}}}*/
-int main(int argc,const char *argv[])                                  /*{{{*/
+std::vector<aptDispatchWithHelp> GetCommands()                         /*{{{*/
 {
-   InitLocale();
-
-   CommandLine::DispatchWithHelp Cmds[] = {
+   return {
       {"update", &DoUpdate, _("Retrieve new lists of packages")},
       {"upgrade", &DoUpgrade, _("Perform an upgrade")},
       {"install", &DoInstall, _("Install new packages (pkg is libc6 not libc6.deb)")},
@@ -1642,10 +1637,15 @@ int main(int argc,const char *argv[])                                   /*{{{*/
       {"moo", &DoMoo, nullptr},
       {nullptr, nullptr, nullptr}
    };
+}
+                                                                       /*}}}*/
+int main(int argc,const char *argv[])                                  /*{{{*/
+{
+   InitLocale();
 
    // Parse the command line and initialize the package library
    CommandLine CmdL;
-   ParseCommandLine(CmdL, Cmds, "apt-get", &_config, &_system, argc, argv, ShowHelp);
+   auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_GET, &_config, &_system, argc, argv);
 
    InitSignals();
    InitOutput();