aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-17 12:41:01 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-17 12:41:01 +0100
commita09238d98199165bcfb859e618bfac3d65b9089f (patch)
tree336beb7c424200f89abd1e93121a27a9ecd44345
parent930c799a1cc6bb6c33ce1b5fe029f2c4848d69b0 (diff)
downloadpaludis-a09238d98199165bcfb859e618bfac3d65b9089f.tar.gz
paludis-a09238d98199165bcfb859e618bfac3d65b9089f.tar.xz
fmt info contents
-rw-r--r--src/clients/cave/cmd_info-fmt.hh13
-rw-r--r--src/clients/cave/cmd_info.cc13
-rw-r--r--src/clients/cave/formats.cc24
-rw-r--r--src/clients/cave/formats.hh5
4 files changed, 18 insertions, 37 deletions
diff --git a/src/clients/cave/cmd_info-fmt.hh b/src/clients/cave/cmd_info-fmt.hh
index 919c93e..3878f05 100644
--- a/src/clients/cave/cmd_info-fmt.hh
+++ b/src/clients/cave/cmd_info-fmt.hh
@@ -15,3 +15,16 @@ const auto fs_id_heading = make_format_string_fetcher("info/id_heading", 1)
const auto fs_heading = make_format_string_fetcher("info/heading", 1)
<< c::blue_or_pink() << param<'s'>() << c::normal() << ":\\n";
+const auto fs_contents_file = make_format_string_fetcher("info/contents_file", 1)
+ << param_if<'b'>() << "%{column 30}" << param_endif<'b'>() << param<'r'>() << param_if<'b'>() << "\\n" << param_else<'b'>() << " " << param_endif<'b'>();
+
+const auto fs_contents_other = make_format_string_fetcher("info/contents_other", 1)
+ << param_if<'b'>() << "%{column 30}" << param_endif<'b'>() << param<'r'>() << param_if<'b'>() << "\\n" << param_else<'b'>() << " " << param_endif<'b'>();
+
+const auto fs_contents_dir = make_format_string_fetcher("info/contents_dir", 1)
+ << param_if<'b'>() << "%{column 30}" << param_endif<'b'>() << param<'r'>() << param_if<'b'>() << "\\n" << param_else<'b'>() << " " << param_endif<'b'>();
+
+const auto fs_contents_sym = make_format_string_fetcher("info/contents_sym", 1)
+ << param_if<'b'>() << "%{column 30}" << param_endif<'b'>() << param<'r'>() << " -> " << param<'v'>()
+ << param_if<'b'>() << "\\n" << param_else<'b'>() << " " << param_endif<'b'>();
+
diff --git a/src/clients/cave/cmd_info.cc b/src/clients/cave/cmd_info.cc
index 3fda0e2..127dc20 100644
--- a/src/clients/cave/cmd_info.cc
+++ b/src/clients/cave/cmd_info.cc
@@ -113,26 +113,23 @@ namespace
void visit(const ContentsFileEntry & e)
{
- s << format_general_rhvib(f::show_contents_file(), stringify(e.location_key()->value()), e.location_key()->value().basename(),
- "", indent, indent);
+ s << fuc(fs_contents_file(), fv<'r'>(stringify(e.location_key()->value())), fv<'b'>(indent ? "true" : ""));
}
void visit(const ContentsDirEntry & e)
{
- s << format_general_rhvib(f::show_contents_dir(), stringify(e.location_key()->value()), e.location_key()->value().basename(),
- "", indent, indent);
+ s << fuc(fs_contents_dir(), fv<'r'>(stringify(e.location_key()->value())), fv<'b'>(indent ? "true" : ""));
}
void visit(const ContentsSymEntry & e)
{
- s << format_general_rhvib(f::show_contents_sym(), stringify(e.location_key()->value()), e.location_key()->value().basename(),
- e.target_key()->value(), indent, indent);
+ s << fuc(fs_contents_sym(), fv<'r'>(stringify(e.location_key()->value())), fv<'b'>(indent ? "true" : ""),
+ fv<'v'>(e.target_key()->value()));
}
void visit(const ContentsOtherEntry & e)
{
- s << format_general_rhvib(f::show_contents_other(), stringify(e.location_key()->value()), e.location_key()->value().basename(),
- "", indent, indent);
+ s << fuc(fs_contents_other(), fv<'r'>(stringify(e.location_key()->value())), fv<'b'>(indent ? "true" : ""));
}
};
diff --git a/src/clients/cave/formats.cc b/src/clients/cave/formats.cc
index fa54407..7715d26 100644
--- a/src/clients/cave/formats.cc
+++ b/src/clients/cave/formats.cc
@@ -233,30 +233,6 @@ paludis::cave::f::show_package_id_masks_overridden()
}
const std::string
-paludis::cave::f::show_contents_file()
-{
- return "%{if b}%{column 30}%{endif}%r%{if b}\\n%{else} %{endif}";
-}
-
-const std::string
-paludis::cave::f::show_contents_other()
-{
- return "%{if b}%{column 30}%{endif}%r%{if b}\\n%{else} %{endif}";
-}
-
-const std::string
-paludis::cave::f::show_contents_dir()
-{
- return "%{if b}%{column 30}%{endif}%r%{if b}\\n%{else} %{endif}";
-}
-
-const std::string
-paludis::cave::f::show_contents_sym()
-{
- return "%{if b}%{column 30}%{endif}%r -> %v%{if b}\\n%{else} %{endif}";
-}
-
-const std::string
paludis::cave::f::show_choice_forced_enabled()
{
return c::green_or_pink() + "(%s)" + c::normal() + "%r";
diff --git a/src/clients/cave/formats.hh b/src/clients/cave/formats.hh
index 557c138..ce61a63 100644
--- a/src/clients/cave/formats.hh
+++ b/src/clients/cave/formats.hh
@@ -69,11 +69,6 @@ namespace paludis
const std::string show_metadata_subsection_raw();
const std::string show_metadata_subsection_human();
- const std::string show_contents_file();
- const std::string show_contents_dir();
- const std::string show_contents_sym();
- const std::string show_contents_other();
-
const std::string show_choice_forced_enabled();
const std::string show_choice_enabled();
const std::string show_choice_forced_disabled();