diff options
author | 2010-08-17 11:39:42 +0100 | |
---|---|---|
committer | 2010-08-17 11:39:42 +0100 | |
commit | bc22ef1797cb07135fd46f3e8f1289e9220e38cf (patch) | |
tree | c86457a6e899964d908ac41a51c1a60eede54dbe | |
parent | a1ec26f46462d86585850ef96cb691ff30f9300e (diff) | |
download | paludis-bc22ef1797cb07135fd46f3e8f1289e9220e38cf.tar.gz paludis-bc22ef1797cb07135fd46f3e8f1289e9220e38cf.tar.xz |
fmt show repository
-rw-r--r-- | src/clients/cave/Makefile.am | 2 | ||||
-rw-r--r-- | src/clients/cave/cmd_print_formats.cc | 2 | ||||
-rw-r--r-- | src/clients/cave/cmd_show-fmt.hh | 5 | ||||
-rw-r--r-- | src/clients/cave/cmd_show.cc | 5 | ||||
-rw-r--r-- | src/clients/cave/formats.cc | 6 | ||||
-rw-r--r-- | src/clients/cave/formats.hh | 2 |
6 files changed, 12 insertions, 10 deletions
diff --git a/src/clients/cave/Makefile.am b/src/clients/cave/Makefile.am index 0a9601541..c93059702 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 b3a0c82a3..8413a1138 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 000000000..fbd8da341 --- /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 a17d27075..16d6e625c 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 54373d9b6..eb50ed07c 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 a8aedbe08..b3fe520de 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(); |