summaryrefslogtreecommitdiff
path: root/cmdline/apt-cache.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2015-08-14 15:07:28 +0200
committerJulian Andres Klode <jak@debian.org>2015-08-14 15:07:28 +0200
commit714c23a791971037518ccc07c497fe3c6451f82c (patch)
tree3d30670dd3df4645793ca1277ac3ec7ecc35732a /cmdline/apt-cache.cc
parentb7bbde252027fb582cc1050e42ef5831275289fa (diff)
apt-cache: Show an error if stats gets any arguments
Closes: #153161
Diffstat (limited to 'cmdline/apt-cache.cc')
-rw-r--r--cmdline/apt-cache.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 117a44292..a03224986 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -310,10 +310,15 @@ static void ShowHashTableStats(std::string Type,
// Stats - Dump some nice statistics /*{{{*/
// ---------------------------------------------------------------------
/* */
-static bool Stats(CommandLine &)
+static bool Stats(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
+
+ if (CmdL.FileSize() > 1) {
+ _error->Error(_("apt-cache stats does not take any arguments"));
+ return false;
+ }
if (unlikely(Cache == NULL))
return false;