X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/1dd20368486820efb6ef4476ad739e967174bec4..c21dab6848cbe90736a998cbec8050fdf5110dd7:/ftparchive/apt-ftparchive.cc?ds=sidebyside diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc index c7e38badf..ab6f48d61 100644 --- a/ftparchive/apt-ftparchive.cc +++ b/ftparchive/apt-ftparchive.cc @@ -615,7 +615,7 @@ static void LoadBinDir(vector &PkgList,Configuration &Setup) } /*}}}*/ -bool ShowHelp(CommandLine &) /*{{{*/ +static bool ShowHelp(CommandLine &) /*{{{*/ { std::cout << _("Usage: apt-ftparchive [options] command\n" @@ -819,12 +819,12 @@ static bool DoGeneratePackagesAndSources(Configuration &Setup, _error->DumpErrors(); // Do the generation for Packages - for (End = List; End->Str != 0; End++) + for (End = List; End->Str != 0; ++End) { if (End->Hit == false) continue; - PackageMap *I = (PackageMap *)End->UserData; + PackageMap * const I = static_cast(End->UserData); if (I->PkgDone == true) continue; if (I->GenPackages(Setup,Stats) == false) @@ -832,12 +832,12 @@ static bool DoGeneratePackagesAndSources(Configuration &Setup, } // Do the generation for Sources - for (End = List; End->Str != 0; End++) + for (End = List; End->Str != 0; ++End) { if (End->Hit == false) continue; - PackageMap *I = (PackageMap *)End->UserData; + PackageMap * const I = static_cast(End->UserData); if (I->SrcDone == true) continue; if (I->GenSources(Setup,SrcStats) == false) @@ -1029,7 +1029,7 @@ static bool Clean(CommandLine &CmdL) } /*}}}*/ -std::vector GetCommands() /*{{{*/ +static std::vector GetCommands() /*{{{*/ { return { {"packages",&SimpleGenPackages, nullptr}, @@ -1044,11 +1044,9 @@ std::vector GetCommands() /*{{{*/ /*}}}*/ 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_FTPARCHIVE, &_config, NULL, argc, argv); + auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_FTPARCHIVE, &_config, NULL, argc, argv, ShowHelp, &GetCommands); _config->CndSet("quiet",0); Quiet = _config->FindI("quiet",0);