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);
return true;
}
/*}}}*/
-int main(int argc,const char *argv[]) /*{{{*/
+std::vector<aptDispatchWithHelp> 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)")},
{"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();