aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-17 13:39:43 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-17 13:39:52 +0100
commit9a11823e1d8a389e00086f22d4e3742a18a12122 (patch)
tree021ef6a2f0b9900b84f4613767bf157dffeae715
parent499b7d8e347e576018dfaba4889431d4676ae6bf (diff)
downloadpaludis-9a11823e1d8a389e00086f22d4e3742a18a12122.tar.gz
paludis-9a11823e1d8a389e00086f22d4e3742a18a12122.tar.xz
fmt show package id
-rw-r--r--src/clients/cave/cmd_show-fmt.hh9
-rw-r--r--src/clients/cave/cmd_show.cc6
-rw-r--r--src/clients/cave/formats.cc18
-rw-r--r--src/clients/cave/formats.hh4
4 files changed, 12 insertions, 25 deletions
diff --git a/src/clients/cave/cmd_show-fmt.hh b/src/clients/cave/cmd_show-fmt.hh
index 2b71fa7..5ac04ec 100644
--- a/src/clients/cave/cmd_show-fmt.hh
+++ b/src/clients/cave/cmd_show-fmt.hh
@@ -76,3 +76,12 @@ const auto fs_metadata_subsection_raw = make_format_string_fetcher("show/metadat
<< " " << param<'i'>() << param<'i'>() << param<'i'>() << param<'i'>()
<< c::bold_blue_or_pink() << param<'s'>() << c::normal() << "\\n";
+const auto fs_package_id_heading = make_format_string_fetcher("show/package_id_heading", 1)
+ << " " << c::bold_blue_or_pink() << param<'s'>() << c::normal() << "\\n";
+
+const auto fs_package_id_masks = make_format_string_fetcher("show/package_id_masks", 1)
+ << " " << c::bold_red() << param<'s'>() << c::normal() << "\\n";
+
+const auto fs_package_id_masks_overridden = make_format_string_fetcher("show/package_id_masks_overridden", 1)
+ << " " << c::green_or_pink() << param<'s'>() << c::normal() << "\\n";
+
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index d85293c..639e167 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -960,7 +960,7 @@ namespace
const std::shared_ptr<const PackageID> & maybe_old_id,
const bool old_id_is_installed)
{
- cout << format_general_s(f::show_package_id_heading(), stringify(*best));
+ cout << fuc(fs_package_id_heading(), fv<'s'>(stringify(*best)));
std::set<std::shared_ptr<const MetadataKey>, MetadataKeyComparator> keys(best->begin_metadata(), best->end_metadata());
for (std::set<std::shared_ptr<const MetadataKey>, MetadataKeyComparator>::const_iterator
k(keys.begin()), k_end(keys.end()) ; k != k_end ; ++k)
@@ -972,14 +972,14 @@ namespace
if (best->masked())
{
- cout << format_general_s(f::show_package_id_masks(), "Masked");
+ cout << fuc(fs_package_id_masks(), fv<'s'>("Masked"));
MaskDisplayer d(cmdline, 2);
std::for_each(indirect_iterator(best->begin_masks()), indirect_iterator(best->end_masks()), accept_visitor(d));
}
if (best->begin_overridden_masks() != best->end_overridden_masks())
{
- cout << format_general_s(f::show_package_id_masks_overridden(), "Overridden Masks");
+ cout << fuc(fs_package_id_masks_overridden(), fv<'s'>("Overridden Masks"));
MaskDisplayer d(cmdline, 2);
for (PackageID::OverriddenMasksConstIterator m(best->begin_overridden_masks()), m_end(best->end_overridden_masks()) ;
m != m_end ; ++m)
diff --git a/src/clients/cave/formats.cc b/src/clients/cave/formats.cc
index 9732898..df938c3 100644
--- a/src/clients/cave/formats.cc
+++ b/src/clients/cave/formats.cc
@@ -184,21 +184,3 @@ paludis::cave::f::show_package_no_slot()
return " {no slot}";
}
-const std::string
-paludis::cave::f::show_package_id_heading()
-{
- return " " + c::bold_blue_or_pink() + "%s" + c::normal() + "\\n";
-}
-
-const std::string
-paludis::cave::f::show_package_id_masks()
-{
- return " " + c::bold_red() + "%s" + c::normal() + "\\n";
-}
-
-const std::string
-paludis::cave::f::show_package_id_masks_overridden()
-{
- return " " + c::green_or_pink() + "%s" + c::normal() + "\\n";
-}
-
diff --git a/src/clients/cave/formats.hh b/src/clients/cave/formats.hh
index 1e24feb..e323e65 100644
--- a/src/clients/cave/formats.hh
+++ b/src/clients/cave/formats.hh
@@ -58,10 +58,6 @@ namespace paludis
const std::string show_package_best();
const std::string show_package_slot();
const std::string show_package_no_slot();
-
- const std::string show_package_id_heading();
- const std::string show_package_id_masks();
- const std::string show_package_id_masks_overridden();
}
}
}