aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-23 23:10:19 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-23 23:10:19 +0000
commite2e9605fd206680d6dbe54af0057db5e89e1e5e0 (patch)
treefd98578b6cd60cd7bbfd92f40dc3021ede36af09
parentc81e35ab62bda3a525e0fcc3feaae47ddbb18eac (diff)
downloadpaludis-e2e9605fd206680d6dbe54af0057db5e89e1e5e0.tar.gz
paludis-e2e9605fd206680d6dbe54af0057db5e89e1e5e0.tar.xz
Don't show Homepage, Description, Licence if they're empty.
-rw-r--r--src/query.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/query.cc b/src/query.cc
index 5410aa8..89790b3 100644
--- a/src/query.cc
+++ b/src/query.cc
@@ -119,13 +119,17 @@ void do_one_query(
/* display metadata */
p::VersionMetadata::ConstPointer metadata(env->package_database()->fetch_metadata(*entries->last()));
- std::cout << " " << std::setw(22) << std::left << "Homepage:" << std::setw(0) <<
- " " << metadata->get(p::vmk_homepage) << std::endl;
- std::cout << " " << std::setw(22) << std::left << "Description:" << std::setw(0) <<
- " " << metadata->get(p::vmk_description) << std::endl;
+
+ if (! metadata->get(p::vmk_homepage).empty())
+ std::cout << " " << std::setw(22) << std::left << "Homepage:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_homepage) << std::endl;
+ if (! metadata->get(p::vmk_description).empty())
+ std::cout << " " << std::setw(22) << std::left << "Description:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_description) << std::endl;
if (CommandLine::get_instance()->a_show_license.specified())
- std::cout << " " << std::setw(22) << std::left << "License:" << std::setw(0) <<
- " " << metadata->get(p::vmk_license) << std::endl;
+ if (! metadata->get(p::vmk_license).empty())
+ std::cout << " " << std::setw(22) << std::left << "License:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_license) << std::endl;
/* blank line */
std::cout << std::endl;