diff options
author | 2010-08-23 11:29:57 +0100 | |
---|---|---|
committer | 2010-08-23 11:29:57 +0100 | |
commit | 5c9d12948254a879d63e2eae810b982ab68758e0 (patch) | |
tree | 291663822b370ea05b2c1e956005d5a230894969 | |
parent | 9a3640388f5cd19b03dc05bd534da15c6d96d5fc (diff) | |
download | paludis-5c9d12948254a879d63e2eae810b982ab68758e0.tar.gz paludis-5c9d12948254a879d63e2eae810b982ab68758e0.tar.xz |
Formattify update-world
Fixes: ticket:972
-rw-r--r-- | src/clients/cave/Makefile.am | 2 | ||||
-rw-r--r-- | src/clients/cave/cmd_dump_cave_formats_conf.cc | 2 | ||||
-rw-r--r-- | src/clients/cave/cmd_update_world-fmt.hh | 14 | ||||
-rw-r--r-- | src/clients/cave/cmd_update_world.cc | 11 |
4 files changed, 24 insertions, 5 deletions
diff --git a/src/clients/cave/Makefile.am b/src/clients/cave/Makefile.am index 53e129a71..49518b231 100644 --- a/src/clients/cave/Makefile.am +++ b/src/clients/cave/Makefile.am @@ -157,7 +157,7 @@ libcave_a_SOURCES = \ 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 \ + cmd_update_world.cc cmd_update_world.hh cmd_update_world-fmt.hh \ cmd_verify.cc cmd_verify.hh cmd_verify-fmt.hh \ colours.cc colours.hh \ exceptions.cc exceptions.hh \ diff --git a/src/clients/cave/cmd_dump_cave_formats_conf.cc b/src/clients/cave/cmd_dump_cave_formats_conf.cc index 864c7fff3..8539aed96 100644 --- a/src/clients/cave/cmd_dump_cave_formats_conf.cc +++ b/src/clients/cave/cmd_dump_cave_formats_conf.cc @@ -142,6 +142,8 @@ namespace }{ #include "cmd_sync-fmt.hh" }{ +#include "cmd_update_world-fmt.hh" + }{ #include "cmd_verify-fmt.hh" }{ #include "colour_formatter-fmt.hh" diff --git a/src/clients/cave/cmd_update_world-fmt.hh b/src/clients/cave/cmd_update_world-fmt.hh new file mode 100644 index 000000000..3a3323d53 --- /dev/null +++ b/src/clients/cave/cmd_update_world-fmt.hh @@ -0,0 +1,14 @@ +/* vim: set sw=4 sts=4 et foldmethod=syntax : */ + +const auto fs_removed = make_format_string_fetcher("update-world/removed", 1) + << "* Removed '" << param<'n'>() << "'" << "\\n"; + +const auto fs_did_not_remove = make_format_string_fetcher("update-world/did_not_remove", 1) + << "* Nothing to remove for '" << param<'n'>() << "'" << "\\n"; + +const auto fs_added = make_format_string_fetcher("update-world/added", 1) + << "* Added '" << param<'n'>() << "'" << "\\n"; + +const auto fs_did_not_add = make_format_string_fetcher("update-world/did-not-add", 1) + << "* Did not need to add '" << param<'n'>() << "'" << "\\n"; + diff --git a/src/clients/cave/cmd_update_world.cc b/src/clients/cave/cmd_update_world.cc index cc4d1ce22..4cf257a9f 100644 --- a/src/clients/cave/cmd_update_world.cc +++ b/src/clients/cave/cmd_update_world.cc @@ -18,6 +18,7 @@ */ #include "cmd_update_world.hh" +#include "format_user_config.hh" #include <paludis/args/args.hh> #include <paludis/args/do_help.hh> #include <paludis/util/wrapped_forward_iterator.hh> @@ -44,6 +45,8 @@ using std::endl; namespace { +#include "cmd_update_world-fmt.hh" + struct UpdateWorldCommandLine : CaveCommandCommandLine { @@ -150,16 +153,16 @@ UpdateWorldCommand::run( if (cmdline.a_remove.specified()) { if (result) - cout << "* Removed '" << name << "'" << endl; + cout << fuc(fs_removed(), fv<'n'>(stringify(name))); else - cout << "* Did not remove '" << name << "'" << endl; + cout << fuc(fs_did_not_remove(), fv<'n'>(stringify(name))); } else { if (result) - cout << "* Added '" << name << "'" << endl; + cout << fuc(fs_added(), fv<'n'>(stringify(name))); else - cout << "* Did not need to add '" << name << "'" << endl; + cout << fuc(fs_did_not_add(), fv<'n'>(stringify(name))); } } } |