]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-cdrom.cc
streamline display of --help in all tools
[apt.git] / cmdline / apt-cdrom.cc
index 53efe65b89afcfeac2d5abbab55c291aaf261b67..8ac73fd7ed4869ad48faaf36f7629e6d933f6c8b 100644 (file)
@@ -249,19 +249,8 @@ int main(int argc,const char *argv[])                                      /*{{{*/
    textdomain(PACKAGE);
 
    // Parse the command line and initialize the package library
-   CommandLine CmdL(Args.data(),_config);
-   if (pkgInitConfig(*_config) == false ||
-       CmdL.Parse(argc,argv) == false ||
-       pkgInitSystem(*_config,_system) == false)
-   {
-      _error->DumpErrors();
-      return 100;
-   }
-
-   // See if the help should be shown
-   if (_config->FindB("help") == true || _config->FindB("version") == true ||
-       CmdL.FileSize() == 0)
-      return ShowHelp(CmdL);
+   CommandLine CmdL;
+   ParseCommandLine(CmdL, Cmds, Args.data(), &_config, &_system, argc, argv, ShowHelp);
 
    // Deal with stdout not being a tty
    if (isatty(STDOUT_FILENO) && _config->FindI("quiet", -1) == -1)