From: Jan Kupec Date: Thu, 12 Oct 2006 14:41:25 +0000 (+0000) Subject: search by resolvable type added X-Git-Tag: BASE-SuSE-SLE-10-SP2-Branch~273 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3587ba703c5c0b42b6aa4561b7fb4111a516e27;p=platform%2Fupstream%2Flibzypp.git search by resolvable type added --- diff --git a/tools/zmart/zypper.cc b/tools/zmart/zypper.cc index a390b02..33564ba 100644 --- a/tools/zmart/zypper.cc +++ b/tools/zmart/zypper.cc @@ -307,7 +307,8 @@ int main(int argc, char **argv) {"uninstalled-only", no_argument, 0, 'u'}, {"match-all", no_argument, 0, 0}, {"match-any", no_argument, 0, 0}, - {"help", no_argument, 0, 0} + {"type", required_argument, 0, 't'}, + {"help", no_argument, 0, 0}, }; specific_options = search_options; specific_help = @@ -316,10 +317,11 @@ int main(int argc, char **argv) "'search' - Search for packages matching given search strings\n" "\n" " Command options:\n" - " --match-all Search for a match to all search strings (default)\n" - " --match-any Search for a match to any of the search strings\n" - "-i, --installed-only Show only packages that are already installed.\n" - "-u, --uninstalled-only Show only packages that are not curenly installed.\n" + " --match-all Search for a match to all search strings (default)\n" + " --match-any Search for a match to any of the search strings\n" + "-i, --installed-only Show only packages that are already installed.\n" + "-u, --uninstalled-only Show only packages that are not curenly installed.\n" + "-t, --type Search only for resolvables of specified type.\n" ; } else { @@ -630,6 +632,16 @@ int main(int argc, char **argv) options.setMatchAny(); } + if (copts.count("type")) { + string skind = copts["type"].front(); + kind = string_to_kind (skind); + if (kind == ResObject::Kind ()) { + cerr << "Unknown resolvable type " << skind << endl; + return 1; + } + options.setKind(kind); + } + ZyppSearch search(options,arguments); Table const &t = search.doSearch(); if (t.empty())