diff options
Diffstat (limited to 'ftparchive/apt-ftparchive.cc')
-rw-r--r-- | ftparchive/apt-ftparchive.cc | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc index 3f2af915b..857f0aff5 100644 --- a/ftparchive/apt-ftparchive.cc +++ b/ftparchive/apt-ftparchive.cc @@ -606,7 +606,7 @@ static void LoadBinDir(vector<PackageMap> &PkgList,Configuration &Setup) // ShowHelp - Show the help text /*{{{*/ // --------------------------------------------------------------------- /* */ -static bool ShowHelp(CommandLine &) +static bool ShowHelp(CommandLine &, CommandLine::DispatchWithHelp const *) { ioprintf(cout, "%s %s (%s)\n", PACKAGE, PACKAGE_VERSION, COMMON_ARCH); if (_config->FindB("version") == true) @@ -661,7 +661,7 @@ static bool ShowHelp(CommandLine &) static bool SimpleGenPackages(CommandLine &CmdL) { if (CmdL.FileSize() < 2) - return ShowHelp(CmdL); + return ShowHelp(CmdL, nullptr); string Override; if (CmdL.FileSize() >= 3) @@ -693,7 +693,7 @@ static bool SimpleGenPackages(CommandLine &CmdL) static bool SimpleGenContents(CommandLine &CmdL) { if (CmdL.FileSize() < 2) - return ShowHelp(CmdL); + return ShowHelp(CmdL, nullptr); // Create a package writer object. ContentsWriter Contents(NULL, _config->Find("APT::FTPArchive::DB"), _config->Find("APT::FTPArchive::Architecture")); @@ -715,7 +715,7 @@ static bool SimpleGenContents(CommandLine &CmdL) static bool SimpleGenSources(CommandLine &CmdL) { if (CmdL.FileSize() < 2) - return ShowHelp(CmdL); + return ShowHelp(CmdL, nullptr); string Override; if (CmdL.FileSize() >= 3) @@ -752,7 +752,7 @@ static bool SimpleGenSources(CommandLine &CmdL) static bool SimpleGenRelease(CommandLine &CmdL) { if (CmdL.FileSize() < 2) - return ShowHelp(CmdL); + return ShowHelp(CmdL, nullptr); string Dir = CmdL.FileList[1]; @@ -920,7 +920,7 @@ static bool Generate(CommandLine &CmdL) { struct CacheDB::Stats SrcStats; if (CmdL.FileSize() < 2) - return ShowHelp(CmdL); + return ShowHelp(CmdL, nullptr); struct timeval StartTime; gettimeofday(&StartTime,0); @@ -978,7 +978,7 @@ static bool Generate(CommandLine &CmdL) static bool Clean(CommandLine &CmdL) { if (CmdL.FileSize() != 2) - return ShowHelp(CmdL); + return ShowHelp(CmdL, nullptr); // Read the configuration file. Configuration Setup; @@ -1045,14 +1045,16 @@ int main(int argc, const char *argv[]) {'c',"config-file",0,CommandLine::ConfigFile}, {'o',"option",0,CommandLine::ArbItem}, {0,0,0,0}}; - CommandLine::Dispatch Cmds[] = {{"packages",&SimpleGenPackages}, - {"contents",&SimpleGenContents}, - {"sources",&SimpleGenSources}, - {"release",&SimpleGenRelease}, - {"generate",&Generate}, - {"clean",&Clean}, - {"help",&ShowHelp}, - {0,0}}; + + CommandLine::DispatchWithHelp Cmds[] = { + {"packages",&SimpleGenPackages, nullptr}, + {"contents",&SimpleGenContents, nullptr}, + {"sources",&SimpleGenSources, nullptr}, + {"release",&SimpleGenRelease, nullptr}, + {"generate",&Generate, nullptr}, + {"clean",&Clean, nullptr}, + {nullptr, nullptr, nullptr} + }; // Parse the command line and initialize the package library CommandLine CmdL(Args,_config); |