From 011188e3920f21e6883c2dab956b3d4fb4e8cbfa Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 25 Oct 2015 23:45:09 +0100 Subject: generate commands array after config is loaded This ensures that location strings loaded from a location specified via configuration (Dir::Locale) effect the help messages for commands. Git-Dch: Ignore --- cmdline/apt-internal-solver.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'cmdline/apt-internal-solver.cc') diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index 278f6d471..f6eaa11f7 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -42,9 +42,7 @@ /*}}}*/ // ShowHelp - Show a help screen /*{{{*/ -// --------------------------------------------------------------------- -/* */ -static bool ShowHelp(CommandLine &, CommandLine::DispatchWithHelp const *) { +bool ShowHelp(CommandLine &, CommandLine::DispatchWithHelp const *) { ioprintf(std::cout, "%s %s (%s)\n", PACKAGE, PACKAGE_VERSION, COMMON_ARCH); std::cout << @@ -67,6 +65,11 @@ APT_NORETURN static void DIE(std::string const &message) { /*{{{*/ exit(EXIT_FAILURE); } /*}}}*/ +std::vector GetCommands() /*{{{*/ +{ + return {}; +} + /*}}}*/ int main(int argc,const char *argv[]) /*{{{*/ { InitLocale(); @@ -75,7 +78,7 @@ int main(int argc,const char *argv[]) /*{{{*/ DropPrivileges(); CommandLine CmdL; - ParseCommandLine(CmdL, nullptr, "apt-internal-solver", &_config, NULL, argc, argv, ShowHelp); + ParseCommandLine(CmdL, APT_CMD::APT_INTERNAL_SOLVER, &_config, NULL, argc, argv); if (CmdL.FileList[0] != 0 && strcmp(CmdL.FileList[0], "scenario") == 0) { @@ -182,6 +185,6 @@ int main(int argc,const char *argv[]) /*{{{*/ EDSP::WriteProgress(100, "Done", output); - return DispatchCommandLine(CmdL, nullptr); + return DispatchCommandLine(CmdL, {}); } /*}}}*/ -- cgit v1.2.3