summaryrefslogtreecommitdiff
path: root/apt-private/private-cmndline.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-09-25 19:58:43 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-11-04 18:04:00 +0100
commit64e3414e00906e6eaa72d7b63ca76d1c59ecadf6 (patch)
tree5425586b556798bc1dbbb35c53e697a5a916394e /apt-private/private-cmndline.cc
parentb49068c566d749130e023536d54588c948c16edf (diff)
allow all dpkg selections to be set via apt-mark and libapt
As we have support for 'hold', we need support for undoing a hold which in effect means that we implemented most other states as well, just that they weren't exposed in the interface directly so far.
Diffstat (limited to 'apt-private/private-cmndline.cc')
-rw-r--r--apt-private/private-cmndline.cc28
1 files changed, 20 insertions, 8 deletions
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc
index 7190fe50b..5d6fd3c2e 100644
--- a/apt-private/private-cmndline.cc
+++ b/apt-private/private-cmndline.cc
@@ -227,19 +227,31 @@ static bool addArgumentsAPTGet(std::vector<CommandLine::Args> &Args, char const
static bool addArgumentsAPTMark(std::vector<CommandLine::Args> &Args, char const * const Cmd)/*{{{*/
{
if (CmdMatches("auto", "manual", "hold", "unhold", "showauto",
- "showmanual", "showhold", "showholds", "install",
+ "showmanual", "showhold", "showholds",
"markauto", "unmarkauto"))
+ {
+ addArg('f',"file","Dir::State::extended_states",CommandLine::HasArg);
+ }
+ else if (CmdMatches("install", "remove", "deinstall", "purge",
+ "showinstall", "showinstalls", "showremove", "showremoves",
+ "showdeinstall", "showdeinstalls", "showpurge", "showpurges"))
;
else
return false;
- addArg('v',"verbose","APT::MarkAuto::Verbose",0);
- addArg('s',"simulate","APT::Mark::Simulate",0);
- addArg('s',"just-print","APT::Mark::Simulate",0);
- addArg('s',"recon","APT::Mark::Simulate",0);
- addArg('s',"dry-run","APT::Mark::Simulate",0);
- addArg('s',"no-act","APT::Mark::Simulate",0);
- addArg('f',"file","Dir::State::extended_states",CommandLine::HasArg);
+ if (CmdMatches("markauto", "unmarkauto"))
+ {
+ addArg('v',"verbose","APT::MarkAuto::Verbose",0);
+ }
+
+ if (strncmp(Cmd, "show", strlen("show")) != 0)
+ {
+ addArg('s',"simulate","APT::Mark::Simulate",0);
+ addArg('s',"just-print","APT::Mark::Simulate",0);
+ addArg('s',"recon","APT::Mark::Simulate",0);
+ addArg('s',"dry-run","APT::Mark::Simulate",0);
+ addArg('s',"no-act","APT::Mark::Simulate",0);
+ }
return true;
}