summaryrefslogtreecommitdiff
path: root/apt-private/private-cmndline.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-08-30 11:29:45 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2014-09-07 19:23:28 +0200
commit859093dae7dcadaff2e15a3885a1824b0d5f5913 (patch)
tree30cc00ed3a906ef741268e6585177dbb1d2b62e6 /apt-private/private-cmndline.cc
parent9622b2111095c3fc705ec0615d27fe403e18c3b8 (diff)
support regular expressions in 'apt search'
apt-cache search supported this since ever and in the code for apt was a fixme indicating this should be added here as well, so here we go.
Diffstat (limited to 'apt-private/private-cmndline.cc')
-rw-r--r--apt-private/private-cmndline.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc
index a21a9dc8c..a4490f5b4 100644
--- a/apt-private/private-cmndline.cc
+++ b/apt-private/private-cmndline.cc
@@ -70,6 +70,8 @@ static bool addArgumentsAPTCache(std::vector<CommandLine::Args> &Args, char cons
else
return false;
+ bool const found_something = Args.empty() == false;
+
// FIXME: move to the correct command(s)
addArg('g', "generate", "APT::Cache::Generate", 0);
addArg('t', "target-release", "APT::Default-Release", CommandLine::HasArg);
@@ -77,7 +79,8 @@ static bool addArgumentsAPTCache(std::vector<CommandLine::Args> &Args, char cons
addArg('p', "pkg-cache", "Dir::Cache::pkgcache", CommandLine::HasArg);
addArg('s', "src-cache", "Dir::Cache::srcpkgcache", CommandLine::HasArg);
- return true;
+
+ return found_something;
}
/*}}}*/
static bool addArgumentsAPTCDROM(std::vector<CommandLine::Args> &Args, char const * const Cmd)/*{{{*/
@@ -172,6 +175,8 @@ static bool addArgumentsAPTGet(std::vector<CommandLine::Args> &Args, char const
addArg('s', "no-act", "APT::Get::Simulate", 0);
}
+ bool const found_something = Args.empty() == false;
+
// FIXME: move to the correct command(s)
addArg('d',"download-only","APT::Get::Download-Only",0);
addArg('y',"yes","APT::Get::Assume-Yes",0);
@@ -197,7 +202,7 @@ static bool addArgumentsAPTGet(std::vector<CommandLine::Args> &Args, char const
addArg(0,"install-suggests","APT::Install-Suggests",CommandLine::Boolean);
addArg(0,"fix-policy","APT::Get::Fix-Policy-Broken",0);
- return true;
+ return found_something;
}
/*}}}*/
static bool addArgumentsAPTMark(std::vector<CommandLine::Args> &Args, char const * const Cmd)/*{{{*/