From 3896c90c2bd4351d142b41f55da7d72a9e15cb84 Mon Sep 17 00:00:00 2001 From: Jan Kupec Date: Sun, 20 Apr 2008 12:25:26 +0000 Subject: [PATCH] - group search result by name-kind by default --- src/zypper-search.h | 6 +----- src/zypper.cc | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/zypper-search.h b/src/zypper-search.h index 44a130d..61c984a 100644 --- a/src/zypper-search.h +++ b/src/zypper-search.h @@ -137,7 +137,6 @@ struct FillSearchTableSelectable header << _("Name"); header << _("Summary"); header << _("Type"); - header << _("Repository"); *_table << header; } @@ -147,11 +146,8 @@ struct FillSearchTableSelectable row << (s->installedEmpty() ? "" : "i"); row << s->name(); - //! \todo improve the abbreviation - row << (_gopts.no_abbrev || s->theObj()->summary().size() < 33 ? - s->theObj()->summary() : s->theObj()->summary().substr(0,28) + "..."); + row << s->theObj()->summary(); row << kind_to_string_localized(s->kind(), 1); - row << selectable_search_repo_str(*s); *_table << row; return true; } diff --git a/src/zypper.cc b/src/zypper.cc index 85047ff..d568e8a 100644 --- a/src/zypper.cc +++ b/src/zypper.cc @@ -1258,6 +1258,7 @@ void Zypper::processCommandOptions() // rug compatibility option, we have --repo {"catalog", required_argument, 0, 'c'}, {"repo", required_argument, 0, 'r'}, + {"details", no_argument, 0, 's'}, {"help", no_argument, 0, 'h'}, {0, 0, 0, 0} }; @@ -1283,6 +1284,8 @@ void Zypper::processCommandOptions() "-r, --repo Search only in the specified repository.\n" " --sort-by-name Sort packages by name (default).\n" " --sort-by-repo Sort packages by repository.\n" + " --details Show each available version in each repository\n" + " on a separate line.\n" "\n" "* and ? wildcards can also be used within search strings.\n" ); @@ -2459,8 +2462,16 @@ void Zypper::doCommand() try { - FillSearchTableSolvable callback(t); - invokeOnEach(query.selectableBegin(), query.selectableEnd(), callback); + if (_copts.count("details")) + { + FillSearchTableSolvable callback(t); + invokeOnEach(query.selectableBegin(), query.selectableEnd(), callback); + } + else + { + FillSearchTableSelectable callback(t); + invokeOnEach(query.selectableBegin(), query.selectableEnd(), callback); + } if (t.empty()) out().info(_("No resolvables found."), Out::QUIET); -- 2.7.4