X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/2b0660b537581e9e65180e4cf1a94d763fd66847..6079b276a959086ff18302cab752b6d7cfe5ad9f:/cmdline/apt-get.cc diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 2a19360c8..69b12b2c7 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1526,10 +1526,7 @@ static bool DoIndexTargets(CommandLine &CmdL) return true; } /*}}}*/ -// ShowHelp - Show a help screen /*{{{*/ -// --------------------------------------------------------------------- -/* */ -static bool ShowHelp(CommandLine &, CommandLine::DispatchWithHelp const * Cmds) +bool ShowHelp(CommandLine &, aptDispatchWithHelp const * Cmds) /*{{{*/ { ioprintf(cout, "%s %s (%s)\n", PACKAGE, PACKAGE_VERSION, COMMON_ARCH); @@ -1613,11 +1610,9 @@ static bool ShowHelp(CommandLine &, CommandLine::DispatchWithHelp const * Cmds) return true; } /*}}}*/ -int main(int argc,const char *argv[]) /*{{{*/ +std::vector GetCommands() /*{{{*/ { - InitLocale(); - - CommandLine::DispatchWithHelp Cmds[] = { + return { {"update", &DoUpdate, _("Retrieve new lists of packages")}, {"upgrade", &DoUpgrade, _("Perform an upgrade")}, {"install", &DoInstall, _("Install new packages (pkg is libc6 not libc6.deb)")}, @@ -1642,10 +1637,15 @@ int main(int argc,const char *argv[]) /*{{{*/ {"moo", &DoMoo, nullptr}, {nullptr, nullptr, nullptr} }; +} + /*}}}*/ +int main(int argc,const char *argv[]) /*{{{*/ +{ + InitLocale(); // Parse the command line and initialize the package library CommandLine CmdL; - ParseCommandLine(CmdL, Cmds, "apt-get", &_config, &_system, argc, argv, ShowHelp); + auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_GET, &_config, &_system, argc, argv); InitSignals(); InitOutput();