]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-sortpkgs.cc
deal with --version more centrally
[apt.git] / cmdline / apt-sortpkgs.cc
index 93aa5a76b64af90fc03851aceba793c9e0995079..f9aa7d728a7f8b5eeef8157b43dd13f0930a4593 100644 (file)
@@ -132,16 +132,9 @@ static bool DoIt(string InFile)
    return true;
 }
                                                                        /*}}}*/
-// ShowHelp - Show the help text                                       /*{{{*/
-// ---------------------------------------------------------------------
-/* */
-static bool ShowHelp(CommandLine &, CommandLine::DispatchWithHelp const *)
+bool ShowHelp(CommandLine &, aptDispatchWithHelp const *)              /*{{{*/
 {
-   ioprintf(std::cout, "%s %s (%s)\n", PACKAGE, PACKAGE_VERSION, COMMON_ARCH);
-   if (_config->FindB("version") == true)
-      return true;
-   
-   cout <<
+   std::cout <<
     _("Usage: apt-sortpkgs [options] file1 [file2 ...]\n"
       "\n"
       "apt-sortpkgs is a simple tool to sort package files. The -s option is used\n"
@@ -152,24 +145,28 @@ static bool ShowHelp(CommandLine &, CommandLine::DispatchWithHelp const *)
       "  -s   Use source file sorting\n"
       "  -c=? Read this configuration file\n"
       "  -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n");
-
    return true;
 }
                                                                        /*}}}*/
+std::vector<aptDispatchWithHelp> GetCommands()                         /*{{{*/
+{
+   return {
+      {nullptr, nullptr, nullptr}
+   };
+}
+                                                                       /*}}}*/
 int main(int argc,const char *argv[])                                  /*{{{*/
 {
    InitLocale();
 
-   // Parse the command line and initialize the package library
-   CommandLine::DispatchWithHelp Cmds[] = {{nullptr, nullptr, nullptr}};
    CommandLine CmdL;
-   ParseCommandLine(CmdL, Cmds, "apt-sortpkgs", &_config, &_system, argc, argv, ShowHelp);
+   ParseCommandLine(CmdL, APT_CMD::APT_SORTPKG, &_config, &_system, argc, argv);
 
    // Match the operation
    for (unsigned int I = 0; I != CmdL.FileSize(); I++)
       if (DoIt(CmdL.FileList[I]) == false)
         break;
 
-   return DispatchCommandLine(CmdL, nullptr);
+   return DispatchCommandLine(CmdL, {});
 }
                                                                        /*}}}*/