diff options
author | 2010-08-17 12:41:01 +0100 | |
---|---|---|
committer | 2010-08-17 12:41:01 +0100 | |
commit | a09238d98199165bcfb859e618bfac3d65b9089f (patch) | |
tree | 336beb7c424200f89abd1e93121a27a9ecd44345 | |
parent | 930c799a1cc6bb6c33ce1b5fe029f2c4848d69b0 (diff) | |
download | paludis-a09238d98199165bcfb859e618bfac3d65b9089f.tar.gz paludis-a09238d98199165bcfb859e618bfac3d65b9089f.tar.xz |
fmt info contents
-rw-r--r-- | src/clients/cave/cmd_info-fmt.hh | 13 | ||||
-rw-r--r-- | src/clients/cave/cmd_info.cc | 13 | ||||
-rw-r--r-- | src/clients/cave/formats.cc | 24 | ||||
-rw-r--r-- | src/clients/cave/formats.hh | 5 |
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 919c93e63..3878f0573 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 3fda0e2f5..127dc20cf 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 fa5440781..7715d2668 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 557c13811..ce61a6361 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(); |