+ /*}}}*/
+static bool ShowHelp(CommandLine &) /*{{{*/
+{
+ std::cout <<
+ _("Usage: apt-cache [options] command\n"
+ " apt-cache [options] show pkg1 [pkg2 ...]\n"
+ "\n"
+ "apt-cache queries and displays available information about installed\n"
+ "and installable packages. It works exclusively on the data acquired\n"
+ "into the local cache via the 'update' command of e.g. apt-get. The\n"
+ "displayed information may therefore be outdated if the last update was\n"
+ "too long ago, but in exchange apt-cache works independently of the\n"
+ "availability of the configured sources (e.g. offline).\n");
+ return true;
+}
+ /*}}}*/
+static std::vector<aptDispatchWithHelp> GetCommands() /*{{{*/
+{
+ return {
+ {"gencaches",&GenCaches, nullptr},
+ {"showsrc",&ShowSrcPackage, _("Show source records")},
+ {"showpkg",&DumpPackage, nullptr},
+ {"stats",&Stats, nullptr},
+ {"dump",&Dump, nullptr},
+ {"dumpavail",&DumpAvail, nullptr},
+ {"unmet",&UnMet, nullptr},
+ {"search",&DoSearch, _("Search the package list for a regex pattern")},
+ {"depends",&Depends, _("Show raw dependency information for a package")},
+ {"rdepends",&RDepends, _("Show reverse dependency information for a package")},
+ {"dotty",&Dotty, nullptr},
+ {"xvcg",&XVcg, nullptr},
+ {"show",&ShowPackage, _("Show a readable record for the package")},
+ {"pkgnames",&ShowPkgNames, _("List the names of all packages in the system")},
+ {"showauto",&ShowAuto, nullptr},
+ {"policy",&Policy, _("Show policy settings")},
+ {"madison",&Madison, nullptr},
+ {nullptr, nullptr, nullptr}
+ };
+}
+ /*}}}*/
+int main(int argc,const char *argv[]) /*{{{*/
+{
+ InitLocale();
+
+ // Parse the command line and initialize the package library
+ CommandLine CmdL;
+ auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_CACHE, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);
+
+ InitOutput();
+
+ if (_config->Exists("APT::Cache::Generate") == true)
+ _config->Set("pkgCacheFile::Generate", _config->FindB("APT::Cache::Generate", true));
+
+ return DispatchCommandLine(CmdL, Cmds);
+}
+ /*}}}*/