aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-17 09:00:56 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-17 09:00:56 +0100
commit8a0077ffafbd9bb6646d11f3ecabe8841e04a5d5 (patch)
tree7c49aa9df1559634dbdacbd3de8a9e1b4973868d
parente673076a22d3ac3261a102b67770f80bf2c744c2 (diff)
downloadpaludis-8a0077ffafbd9bb6646d11f3ecabe8841e04a5d5.tar.gz
paludis-8a0077ffafbd9bb6646d11f3ecabe8841e04a5d5.tar.xz
fmt owner
-rw-r--r--src/clients/cave/Makefile.am2
-rw-r--r--src/clients/cave/cmd_owner-fmt.hh5
-rw-r--r--src/clients/cave/cmd_owner.cc5
-rw-r--r--src/clients/cave/cmd_print_formats.cc1
-rw-r--r--src/clients/cave/formats.cc6
-rw-r--r--src/clients/cave/formats.hh2
6 files changed, 11 insertions, 10 deletions
diff --git a/src/clients/cave/Makefile.am b/src/clients/cave/Makefile.am
index 68ff99b..7b78aa6 100644
--- a/src/clients/cave/Makefile.am
+++ b/src/clients/cave/Makefile.am
@@ -124,7 +124,7 @@ libcave_a_SOURCES = \
cmd_info.cc cmd_info.hh \
cmd_manage_search_index.cc cmd_manage_search_index.hh \
cmd_match.cc cmd_match.hh \
- cmd_owner.cc cmd_owner.hh \
+ cmd_owner.cc cmd_owner.hh cmd_owner-fmt.hh \
cmd_perform.cc cmd_perform.hh \
cmd_print_categories.cc cmd_print_categories.hh \
cmd_print_commands.cc cmd_print_commands.hh \
diff --git a/src/clients/cave/cmd_owner-fmt.hh b/src/clients/cave/cmd_owner-fmt.hh
new file mode 100644
index 0000000..ecb1ce6
--- /dev/null
+++ b/src/clients/cave/cmd_owner-fmt.hh
@@ -0,0 +1,5 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+const auto fs_id = make_format_string_fetcher("owner/id", 1)
+ << c::bold_blue_or_pink() << param<'s'>() << c::normal() << "\\n";
+
diff --git a/src/clients/cave/cmd_owner.cc b/src/clients/cave/cmd_owner.cc
index 15c9980..efe1cbf 100644
--- a/src/clients/cave/cmd_owner.cc
+++ b/src/clients/cave/cmd_owner.cc
@@ -23,6 +23,7 @@
#include "owner_common.hh"
#include "format_general.hh"
#include "formats.hh"
+#include "format_user_config.hh"
#include <paludis/action.hh>
#include <paludis/args/args.hh>
@@ -42,6 +43,8 @@ using std::endl;
namespace
{
+#include "cmd_owner-fmt.hh"
+
struct OwnerCommandLine :
CaveCommandCommandLine
{
@@ -79,7 +82,7 @@ namespace
void format_id(const std::shared_ptr<const PackageID> & id)
{
- cout << format_general_s(f::owner_id(), stringify(*id));
+ cout << fuc(fs_id(), fv<'s'>(stringify(*id)));
}
}
diff --git a/src/clients/cave/cmd_print_formats.cc b/src/clients/cave/cmd_print_formats.cc
index a476071..b2df26d 100644
--- a/src/clients/cave/cmd_print_formats.cc
+++ b/src/clients/cave/cmd_print_formats.cc
@@ -103,6 +103,7 @@ namespace
{
#include "cmd_contents-fmt.hh"
+#include "cmd_owner-fmt.hh"
#include "cmd_report-fmt.hh"
#include "cmd_verify-fmt.hh"
diff --git a/src/clients/cave/formats.cc b/src/clients/cave/formats.cc
index d38399b..00304df 100644
--- a/src/clients/cave/formats.cc
+++ b/src/clients/cave/formats.cc
@@ -641,12 +641,6 @@ paludis::cave::f::sync_repo_tail()
}
const std::string
-paludis::cave::f::owner_id()
-{
- return c::bold_blue_or_pink() + "%s" + c::normal() + "\\n";
-}
-
-const std::string
paludis::cave::f::executables_file()
{
return c::bold_blue_or_pink() + "%s" + c::normal() + "\\n";
diff --git a/src/clients/cave/formats.hh b/src/clients/cave/formats.hh
index 004de1f..01b0193 100644
--- a/src/clients/cave/formats.hh
+++ b/src/clients/cave/formats.hh
@@ -161,8 +161,6 @@ namespace paludis
const std::string sync_repo_active_quiet();
const std::string sync_repo_tail();
- const std::string owner_id();
-
const std::string executables_file();
}
}