]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-sortpkgs.cc
get pdiff files from the same mirror as the index
[apt.git] / cmdline / apt-sortpkgs.cc
index b5a2c12df1155bd00ffe337d8dc9df1d73330e6c..cf19b84ec4f1f89d140bf0903ae6700653e64be6 100644 (file)
@@ -29,6 +29,7 @@
 #include <vector>
 #include <algorithm>
 #include <stdio.h>
 #include <vector>
 #include <algorithm>
 #include <stdio.h>
+#include <unistd.h>
 #include <iostream>
 #include <string>
 #include <memory>
 #include <iostream>
 #include <string>
 #include <memory>
@@ -132,28 +133,18 @@ static bool DoIt(string InFile)
    return true;
 }
                                                                        /*}}}*/
    return true;
 }
                                                                        /*}}}*/
-bool ShowHelp(CommandLine &, aptDispatchWithHelp const *)              /*{{{*/
+static bool ShowHelp(CommandLine &)                                    /*{{{*/
 {
 {
-   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"
     _("Usage: apt-sortpkgs [options] file1 [file2 ...]\n"
       "\n"
-      "apt-sortpkgs is a simple tool to sort package files. The -s option is used\n"
-      "to indicate what kind of file it is.\n"
-      "\n"
-      "Options:\n"
-      "  -h   This help text\n"
-      "  -s   Use source file sorting\n"
-      "  -c=? Read this configuration file\n"
-      "  -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n");
-
+      "apt-sortpkgs is a simple tool to sort package information files.\n"
+      "By default it sorts by binary package information, but the -s option\n"
+      "can be used to switch to source package ordering instead.\n");
    return true;
 }
                                                                        /*}}}*/
    return true;
 }
                                                                        /*}}}*/
-std::vector<aptDispatchWithHelp> GetCommands()                         /*{{{*/
+static std::vector<aptDispatchWithHelp> GetCommands()                  /*{{{*/
 {
    return {
       {nullptr, nullptr, nullptr}
 {
    return {
       {nullptr, nullptr, nullptr}
@@ -162,10 +153,8 @@ std::vector<aptDispatchWithHelp> GetCommands()                             /*{{{*/
                                                                        /*}}}*/
 int main(int argc,const char *argv[])                                  /*{{{*/
 {
                                                                        /*}}}*/
 int main(int argc,const char *argv[])                                  /*{{{*/
 {
-   InitLocale();
-
    CommandLine CmdL;
    CommandLine CmdL;
-   ParseCommandLine(CmdL, APT_CMD::APT_SORTPKG, &_config, &_system, argc, argv);
+   ParseCommandLine(CmdL, APT_CMD::APT_SORTPKG, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);
 
    // Match the operation
    for (unsigned int I = 0; I != CmdL.FileSize(); I++)
 
    // Match the operation
    for (unsigned int I = 0; I != CmdL.FileSize(); I++)