aboutsummaryrefslogtreecommitdiff
path: root/src/output
diff options
context:
space:
mode:
Diffstat (limited to 'src/output')
-rw-r--r--src/output/colour_formatter.cc6
-rw-r--r--src/output/colour_formatter.hh3
-rw-r--r--src/output/console_query_task.cc18
-rw-r--r--src/output/mask_displayer.cc6
4 files changed, 33 insertions, 0 deletions
diff --git a/src/output/colour_formatter.cc b/src/output/colour_formatter.cc
index 6c36f3f7d..0f0aa3e9d 100644
--- a/src/output/colour_formatter.cc
+++ b/src/output/colour_formatter.cc
@@ -183,6 +183,12 @@ ColourFormatter::format(const std::string & f, const format::Plain &) const
}
std::string
+ColourFormatter::format(const std::pair<const std::string, std::string> & f, const format::Plain &) const
+{
+ return stringify(f.first) + "=" + stringify(f.second);
+}
+
+std::string
ColourFormatter::format(const PlainTextLabelDepSpec & f, const format::Plain &) const
{
return stringify(f);
diff --git a/src/output/colour_formatter.hh b/src/output/colour_formatter.hh
index 75c6fab09..5de2b6d82 100644
--- a/src/output/colour_formatter.hh
+++ b/src/output/colour_formatter.hh
@@ -42,6 +42,7 @@ class ColourFormatter :
public paludis::CanFormat<paludis::FSPath>,
public paludis::CanFormat<paludis::PackageID>,
public paludis::CanFormat<std::string>,
+ public paludis::CanFormat<std::pair<const std::string, std::string> >,
public paludis::CanSpace
{
public:
@@ -77,6 +78,8 @@ class ColourFormatter :
std::string format(const std::string &, const paludis::format::Plain &) const;
+ std::string format(const std::pair<const std::string, std::string> &, const paludis::format::Plain &) const;
+
std::string format(const paludis::PlainTextLabelDepSpec &, const paludis::format::Plain &) const;
std::string format(const paludis::URILabelsDepSpec &, const paludis::format::Plain &) const;
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index 94bf3c578..3fee15652 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.cc
@@ -365,6 +365,24 @@ namespace
}
}
+ void visit(const MetadataCollectionKey<Map<std::string, std::string> > & k)
+ {
+ if (k.type() == type)
+ {
+ ColourFormatter formatter;
+ if (task->want_raw())
+ {
+ task->output_left_column(k.raw_name() + ":", in);
+ task->output_right_column(k.pretty_print_flat(formatter));
+ }
+ else
+ {
+ task->output_left_column(k.human_name() + ":", in);
+ task->output_right_column(k.pretty_print_flat(formatter));
+ }
+ }
+ }
+
void visit(const MetadataCollectionKey<Sequence<std::string> > & k)
{
if (k.type() == type)
diff --git a/src/output/mask_displayer.cc b/src/output/mask_displayer.cc
index dd0fb1d37..3b7e9faa6 100644
--- a/src/output/mask_displayer.cc
+++ b/src/output/mask_displayer.cc
@@ -132,6 +132,12 @@ namespace
s << k.pretty_print_flat(formatter);
}
+ void visit(const MetadataCollectionKey<Map<std::string, std::string> > & k)
+ {
+ ColourFormatter formatter;
+ s << k.pretty_print_flat(formatter);
+ }
+
void visit(const MetadataCollectionKey<Sequence<std::string> > & k)
{
ColourFormatter formatter;