diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-10-22 16:28:54 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-11-04 18:04:03 +0100 |
commit | cbbee23e7768750ca1c8b49bdfbf8a650131bbb6 (patch) | |
tree | 8727247578b43b0ae0a56110ff9e0e254157fc76 /ftparchive/apt-ftparchive.cc | |
parent | 995a4bf6d770a5cc824c38388909f23fcca558c3 (diff) |
split up help messages for simpler reuse
That is one huge commit with busy work only: Help messages used to be
one big translateable string, which is a pain for translators and hard
to reuse for us. This change there 'explodes' this single string into
new string for each documented string trying hard to split up the
translated messages as well. This actually restores many translations as
previously adding a single command made all of the bug message fuzzy.
The splitup also highlighted that its easy to forget a line, duplicate
one and similar stuff.
Git-Dch: Ignore
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); |