Skip to content

Commit

Permalink
improve repoquery
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Jan 21, 2022
1 parent f6d69ca commit 7d24fd5
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions libmamba/src/api/repoquery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ namespace mamba
}
else if (type == QueryType::kDEPENDS)
{
// MultiPackageCache package_caches(ctx.pkgs_dirs);
// auto repos = load_channels(pool, package_caches, 0);
auto res = q.depends(query, format == QueryResultFormat::kTREE);
switch (format)
{
Expand All @@ -80,15 +78,11 @@ namespace mamba
std::cout << res.json().dump(4);
break;
case QueryResultFormat::kTABLE:
res.table(std::cout);
res.sort("name").table(std::cout);
}
}
else if (type == QueryType::kWHONEEDS)
{
// MultiPackageCache package_caches(ctx.pkgs_dirs);
// auto repos = load_channels(pool, package_caches, 0);
// query_result res = q.depends(query, (format == query::TREE));
std::cout << "Checking for whoneeds of " << query << std::endl;
auto res = q.whoneeds(query, format == QueryResultFormat::kTREE);
switch (format)
{
Expand All @@ -99,7 +93,9 @@ namespace mamba
std::cout << res.json().dump(4);
break;
case QueryResultFormat::kTABLE:
res.table(std::cout);
res.sort("name").table(
std::cout,
{ "Name", "Version", "Build", concat("Depends:", query), "Channel" });
}
}

Expand Down

0 comments on commit 7d24fd5

Please sign in to comment.