X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/3e68f7e41022790619c698a32390a5256fadba7c..6d7122b5356c0b4d8f51aafdfc1c232392fca695:/apt-private/private-cmndline.cc diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index aa01be757..cfdc13259 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -2,12 +2,17 @@ #include #include +#include +#include +#include +#include #include #include #include #include +#include #include /*}}}*/ @@ -46,6 +51,7 @@ static bool addArgumentsAPTCache(std::vector &Args, char cons addArg(0, "conflicts", "APT::Cache::ShowConflicts", 0); addArg(0, "enhances", "APT::Cache::ShowEnhances", 0); addArg(0, "recurse", "APT::Cache::RecurseDepends", 0); + addArg(0, "implicit", "APT::Cache::ShowImplicit", 0); } else if (CmdMatches("search")) { @@ -158,6 +164,11 @@ static bool addArgumentsAPTGet(std::vector &Args, char const // once sbuild is fixed, this option can be removed addArg('f', "fix-broken", "APT::Get::Fix-Broken", 0); } + else if (CmdMatches("indextargets")) + { + addArg(0,"format","APT::Get::IndexTargets::Format", CommandLine::HasArg); + addArg(0,"release-info","APT::Get::IndexTargets::ReleaseInfo", 0); + } else if (CmdMatches("clean", "autoclean", "check", "download", "changelog") || CmdMatches("markauto", "unmarkauto")) // deprecated commands ; @@ -165,7 +176,7 @@ static bool addArgumentsAPTGet(std::vector &Args, char const addArg(0, "color", "APT::Moo::Color", 0); if (CmdMatches("install", "remove", "purge", "upgrade", "dist-upgrade", - "deselect-upgrade", "autoremove", "clean", "autoclean", "check", + "dselect-upgrade", "autoremove", "clean", "autoclean", "check", "build-dep", "full-upgrade", "source")) { addArg('s', "simulate", "APT::Get::Simulate", 0); @@ -287,3 +298,31 @@ std::vector getCommandArgs(char const * const Program, char c /*}}}*/ #undef CmdMatches #undef addArg +void ParseCommandLine(CommandLine &CmdL, CommandLine::Dispatch * const Cmds, CommandLine::Args * const Args,/*{{{*/ + Configuration * const * const Cnf, pkgSystem ** const Sys, int const argc, const char *argv[], bool(*ShowHelp)(CommandLine &CmdL)) +{ + CmdL = CommandLine(Args,_config); + if ((Cnf != NULL && pkgInitConfig(**Cnf) == false) || + CmdL.Parse(argc,argv) == false || + (Sys != NULL && pkgInitSystem(*_config, *Sys) == false)) + { + if (_config->FindB("version") == true) + ShowHelp(CmdL); + + _error->DumpErrors(); + exit(100); + } + + // See if the help should be shown + if (_config->FindB("help") == true || _config->FindB("version") == true) + { + ShowHelp(CmdL); + exit(0); + } + if (Cmds != NULL && CmdL.FileSize() == 0) + { + ShowHelp(CmdL); + exit(1); + } +} + /*}}}*/