aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-17 14:25:20 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-17 14:26:32 +0100
commit66831bf80a60e46958ac07a270bae92a6c134b1f (patch)
treeb648305ed260b41fdf3891e2749d6a35983cf9a1
parent4c875404ad6f7f221e21f9deaef1abd30683e4f1 (diff)
downloadpaludis-66831bf80a60e46958ac07a270bae92a6c134b1f.tar.gz
paludis-66831bf80a60e46958ac07a270bae92a6c134b1f.tar.xz
fmt perform
-rw-r--r--src/clients/cave/Makefile.am2
-rw-r--r--src/clients/cave/cmd_perform-fmt.hh5
-rw-r--r--src/clients/cave/cmd_perform.cc15
-rw-r--r--src/clients/cave/cmd_print_formats.cc2
4 files changed, 17 insertions, 7 deletions
diff --git a/src/clients/cave/Makefile.am b/src/clients/cave/Makefile.am
index e423acc..c097267 100644
--- a/src/clients/cave/Makefile.am
+++ b/src/clients/cave/Makefile.am
@@ -125,7 +125,7 @@ libcave_a_SOURCES = \
cmd_manage_search_index.cc cmd_manage_search_index.hh \
cmd_match.cc cmd_match.hh \
cmd_owner.cc cmd_owner.hh cmd_owner-fmt.hh \
- cmd_perform.cc cmd_perform.hh \
+ cmd_perform.cc cmd_perform.hh cmd_perform-fmt.hh \
cmd_print_categories.cc cmd_print_categories.hh \
cmd_print_commands.cc cmd_print_commands.hh \
cmd_print_environment_metadata.cc cmd_print_environment_metadata.hh \
diff --git a/src/clients/cave/cmd_perform-fmt.hh b/src/clients/cave/cmd_perform-fmt.hh
new file mode 100644
index 0000000..f18915b
--- /dev/null
+++ b/src/clients/cave/cmd_perform-fmt.hh
@@ -0,0 +1,5 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+const auto fs_x_of_y_title = make_format_string_fetcher("perform/x_of_y_title", 1)
+ << "\\e]2;" << param<'c'>() << param<'x'>() << " " << param<'a'>() << " " << param<'i'>() << "\\a";
+
diff --git a/src/clients/cave/cmd_perform.cc b/src/clients/cave/cmd_perform.cc
index 450c0a0..609ed03 100644
--- a/src/clients/cave/cmd_perform.cc
+++ b/src/clients/cave/cmd_perform.cc
@@ -20,6 +20,7 @@
#include "cmd_perform.hh"
#include "cmd_resolve_cmdline.hh"
#include "exceptions.hh"
+#include "format_user_config.hh"
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
#include <paludis/name.hh>
@@ -57,6 +58,8 @@ using std::endl;
namespace
{
+#include "cmd_perform-fmt.hh"
+
struct PerformCommandLine :
CaveCommandCommandLine
{
@@ -239,8 +242,8 @@ namespace
OutputManagerFromIPCOrEnvironment & output_manager_holder)
{
if (cmdline.a_x_of_y.specified() && ! cmdline.a_no_terminal_titles.specified())
- std::cout << "\x1b]2;" << cmdline.a_x_of_y.argument() << " " << action_name << " "
- << stringify(*id) << "\x07" << std::flush;
+ cout << fuc(fs_x_of_y_title(), fv<'x'>(cmdline.a_x_of_y.argument()),
+ fv<'i'>(stringify(*id)), fv<'a'>(action_name), fv<'c'>("")) << std::flush;
if (cmdline.a_hooks.specified())
if (0 != env->perform_hook(Hook(action_name + "_pre")
@@ -275,8 +278,8 @@ namespace
throw ActionAbortedError("Aborted by hook");
if (cmdline.a_x_of_y.specified() && ! cmdline.a_no_terminal_titles.specified())
- std::cout << "\x1b]2;Completed " << cmdline.a_x_of_y.argument() << " " << action_name << " "
- << stringify(*id) << "\x07" << std::flush;
+ cout << fuc(fs_x_of_y_title(), fv<'x'>(cmdline.a_x_of_y.argument()),
+ fv<'i'>(stringify(*id)), fv<'a'>(action_name), fv<'c'>("Completed ")) << std::flush;
}
bool ignore_nothing(const FSEntry &)
@@ -296,8 +299,8 @@ namespace
execute(env, cmdline, id, "clean", uninstall_action, output_manager_holder);
if (cmdline.a_x_of_y.specified() && ! cmdline.a_no_terminal_titles.specified())
- std::cout << "\x1b]2;" << cmdline.a_x_of_y.argument() << " " << action_name << " "
- << stringify(*id) << "\x07" << std::flush;
+ cout << fuc(fs_x_of_y_title(), fv<'x'>(cmdline.a_x_of_y.argument()),
+ fv<'i'>(stringify(*id)), fv<'a'>(action_name), fv<'c'>("")) << std::flush;
}
struct WantInstallPhase
diff --git a/src/clients/cave/cmd_print_formats.cc b/src/clients/cave/cmd_print_formats.cc
index 4583323..8da7c7a 100644
--- a/src/clients/cave/cmd_print_formats.cc
+++ b/src/clients/cave/cmd_print_formats.cc
@@ -130,6 +130,8 @@ namespace
}{
#include "cmd_owner-fmt.hh"
}{
+#include "cmd_perform-fmt.hh"
+ }{
#include "cmd_report-fmt.hh"
}{
#include "cmd_show-fmt.hh"