summaryrefslogtreecommitdiff
path: root/cmdline/apt-internal-solver.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-10-25 23:45:09 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2015-11-04 18:04:04 +0100
commit011188e3920f21e6883c2dab956b3d4fb4e8cbfa (patch)
tree9649094789cf2369d82758e24995feb2b0bed59c /cmdline/apt-internal-solver.cc
parent2b0660b537581e9e65180e4cf1a94d763fd66847 (diff)
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
Diffstat (limited to 'cmdline/apt-internal-solver.cc')
-rw-r--r--cmdline/apt-internal-solver.cc13
1 files changed, 8 insertions, 5 deletions
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<CommandLine::DispatchWithHelp> 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, {});
}
/*}}}*/