aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-17 09:04:49 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-17 09:04:49 +0100
commit3c710b27ac926f7cc4e05b3147622dd17284149b (patch)
treeb2b086c0536cb8596c516be058113c50de55ad1e
parent8a0077ffafbd9bb6646d11f3ecabe8841e04a5d5 (diff)
downloadpaludis-3c710b27ac926f7cc4e05b3147622dd17284149b.tar.gz
paludis-3c710b27ac926f7cc4e05b3147622dd17284149b.tar.xz
fmt executables
-rw-r--r--src/clients/cave/Makefile.am2
-rw-r--r--src/clients/cave/cmd_executables-fmt.hh5
-rw-r--r--src/clients/cave/cmd_executables.cc5
-rw-r--r--src/clients/cave/cmd_print_formats.cc9
-rw-r--r--src/clients/cave/formats.cc6
-rw-r--r--src/clients/cave/formats.hh2
6 files changed, 17 insertions, 12 deletions
diff --git a/src/clients/cave/Makefile.am b/src/clients/cave/Makefile.am
index 7b78aa6..686afa3 100644
--- a/src/clients/cave/Makefile.am
+++ b/src/clients/cave/Makefile.am
@@ -114,7 +114,7 @@ libcave_a_SOURCES = \
cmd_contents.cc cmd_contents.hh cmd_contents-fmt.hh \
cmd_config.cc cmd_config.hh \
cmd_display_resolution.cc cmd_display_resolution.hh \
- cmd_executables.cc cmd_executables.hh \
+ cmd_executables.cc cmd_executables.hh cmd_executables-fmt.hh \
cmd_execute_resolution.cc cmd_execute_resolution.hh \
cmd_find_candidates.cc cmd_find_candidates.hh \
cmd_fix_cache.cc cmd_fix_cache.hh \
diff --git a/src/clients/cave/cmd_executables-fmt.hh b/src/clients/cave/cmd_executables-fmt.hh
new file mode 100644
index 0000000..c41c639
--- /dev/null
+++ b/src/clients/cave/cmd_executables-fmt.hh
@@ -0,0 +1,5 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+const auto fs_file = make_format_string_fetcher("executables/file", 1)
+ << c::bold_blue_or_pink() << param<'s'>() << c::normal() << "\\n";
+
diff --git a/src/clients/cave/cmd_executables.cc b/src/clients/cave/cmd_executables.cc
index 87941ce..cb4c260 100644
--- a/src/clients/cave/cmd_executables.cc
+++ b/src/clients/cave/cmd_executables.cc
@@ -23,6 +23,7 @@
#include "executables_common.hh"
#include "formats.hh"
#include "format_general.hh"
+#include "format_user_config.hh"
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
@@ -44,6 +45,8 @@ using std::endl;
namespace
{
+#include "cmd_executables-fmt.hh"
+
struct ExecutablesCommandLine :
CaveCommandCommandLine
{
@@ -70,7 +73,7 @@ namespace
void format_fsentry(const FSEntry & f)
{
- cout << format_general_s(f::executables_file(), stringify(f));
+ cout << fuc(fs_file(), fv<'s'>(stringify(f)));
}
}
diff --git a/src/clients/cave/cmd_print_formats.cc b/src/clients/cave/cmd_print_formats.cc
index b2df26d..39c8501 100644
--- a/src/clients/cave/cmd_print_formats.cc
+++ b/src/clients/cave/cmd_print_formats.cc
@@ -101,12 +101,17 @@ namespace
void collect()
{
-
+ {
#include "cmd_contents-fmt.hh"
+ }{
+#include "cmd_executables-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 00304df..fa23fbb 100644
--- a/src/clients/cave/formats.cc
+++ b/src/clients/cave/formats.cc
@@ -640,9 +640,3 @@ paludis::cave::f::sync_repo_tail()
return " ... %s\\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 01b0193..fbead04 100644
--- a/src/clients/cave/formats.hh
+++ b/src/clients/cave/formats.hh
@@ -160,8 +160,6 @@ namespace paludis
const std::string sync_repo_active();
const std::string sync_repo_active_quiet();
const std::string sync_repo_tail();
-
- const std::string executables_file();
}
}
}