aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/clients/cave/Makefile.am2
-rw-r--r--src/clients/cave/cmd_print_formats.cc2
-rw-r--r--src/clients/cave/cmd_show-fmt.hh5
-rw-r--r--src/clients/cave/cmd_show.cc5
-rw-r--r--src/clients/cave/formats.cc6
-rw-r--r--src/clients/cave/formats.hh2
6 files changed, 12 insertions, 10 deletions
diff --git a/src/clients/cave/Makefile.am b/src/clients/cave/Makefile.am
index 0a96015..c930597 100644
--- a/src/clients/cave/Makefile.am
+++ b/src/clients/cave/Makefile.am
@@ -154,7 +154,7 @@ libcave_a_SOURCES = \
cmd_resume.cc cmd_resume.hh \
cmd_search.cc cmd_search.hh \
cmd_search_cmdline.cc cmd_search_cmdline.hh \
- cmd_show.cc cmd_show.hh \
+ cmd_show.cc cmd_show.hh cmd_show-fmt.hh \
cmd_sync.cc cmd_sync.hh cmd_sync-fmt.hh \
cmd_uninstall.cc cmd_uninstall.hh \
cmd_update_world.cc cmd_update_world.hh \
diff --git a/src/clients/cave/cmd_print_formats.cc b/src/clients/cave/cmd_print_formats.cc
index b3a0c82..8413a11 100644
--- a/src/clients/cave/cmd_print_formats.cc
+++ b/src/clients/cave/cmd_print_formats.cc
@@ -114,6 +114,8 @@ namespace
}{
#include "cmd_report-fmt.hh"
}{
+#include "cmd_show-fmt.hh"
+ }{
#include "cmd_sync-fmt.hh"
}{
#include "cmd_verify-fmt.hh"
diff --git a/src/clients/cave/cmd_show-fmt.hh b/src/clients/cave/cmd_show-fmt.hh
new file mode 100644
index 0000000..fbd8da3
--- /dev/null
+++ b/src/clients/cave/cmd_show-fmt.hh
@@ -0,0 +1,5 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+const auto fs_repository_heading = make_format_string_fetcher("show/repository_heading", 1)
+ << "* " << c::bold_blue_or_pink() << param<'s'>() << c::normal() << "\\n";
+
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index a17d270..16d6e62 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -23,6 +23,7 @@
#include "formats.hh"
#include "exceptions.hh"
#include "select_format_for_spec.hh"
+#include "format_user_config.hh"
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
#include <paludis/name.hh>
@@ -63,6 +64,8 @@ using std::endl;
namespace
{
+#include "cmd_show-fmt.hh"
+
struct ShowCommandLine :
CaveCommandCommandLine
{
@@ -821,7 +824,7 @@ namespace
const std::shared_ptr<Environment> & env,
const RepositoryName & s)
{
- cout << format_general_s(f::show_repository_heading(), stringify(s));
+ cout << fuc(fs_repository_heading(), fv<'s'>(stringify(s)));
const std::shared_ptr<const Repository> repo(env->package_database()->fetch_repository(s));
std::set<std::shared_ptr<const MetadataKey>, MetadataKeyComparator> keys(repo->begin_metadata(), repo->end_metadata());
diff --git a/src/clients/cave/formats.cc b/src/clients/cave/formats.cc
index 54373d9..eb50ed0 100644
--- a/src/clients/cave/formats.cc
+++ b/src/clients/cave/formats.cc
@@ -191,12 +191,6 @@ paludis::cave::f::show_wildcard_spec_unavailable()
}
const std::string
-paludis::cave::f::show_repository_heading()
-{
- return "* " + c::bold_blue_or_pink() + "%s" + c::normal() + "\\n";
-}
-
-const std::string
paludis::cave::f::show_metadata_key_value_raw()
{
return " %i%i%i%i%{if b}" + c::bold_normal() + "%{endif}" + "%r" + c::normal() + "%{column 30}%v\\n";
diff --git a/src/clients/cave/formats.hh b/src/clients/cave/formats.hh
index a8aedbe..b3fe520 100644
--- a/src/clients/cave/formats.hh
+++ b/src/clients/cave/formats.hh
@@ -61,8 +61,6 @@ namespace paludis
const std::string show_wildcard_spec_installable();
const std::string show_wildcard_spec_unavailable();
- const std::string show_repository_heading();
-
const std::string show_package_heading();
const std::string show_package_repository();
const std::string show_package_version_installed();