aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-16 14:10:51 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-16 14:10:51 +0100
commit745e314a80bd89380df9c775a3245a398529f838 (patch)
treefe04648ac6af7316e59f1b23cdc2505afbfce647
parent9d74d3bd8273aeb8a194394e1e0c109fa1648a81 (diff)
downloadpaludis-745e314a80bd89380df9c775a3245a398529f838.tar.gz
paludis-745e314a80bd89380df9c775a3245a398529f838.tar.xz
Cave perform --no-terminal-titles
-rw-r--r--src/clients/cave/cmd_perform.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/clients/cave/cmd_perform.cc b/src/clients/cave/cmd_perform.cc
index c9dec31..8ac5457 100644
--- a/src/clients/cave/cmd_perform.cc
+++ b/src/clients/cave/cmd_perform.cc
@@ -80,6 +80,7 @@ namespace
args::SwitchArg a_if_supported;
args::SwitchArg a_hooks;
args::StringArg a_x_of_y;
+ args::SwitchArg a_no_terminal_titles;
args::SwitchArg a_managed_output;
args::EnumArg a_output_exclusivity;
@@ -111,6 +112,8 @@ namespace
"Also execute the appropriate hooks for the action.", true),
a_x_of_y(&g_general_options, "x-of-y", '\0',
"Specify the value of the X_OF_Y variable that is passed to hooks."),
+ a_no_terminal_titles(&g_general_options, "no-terminal-titles", '\0',
+ "Do not change terminal titles", false),
a_managed_output(&g_general_options, "managed-output", '\0',
"Specify that our output is being managed by another process. Used by "
"'cave execute-resolution'; not for end user use.", false),
@@ -234,7 +237,7 @@ namespace
const std::string & action_name,
Action & action)
{
- if (cmdline.a_x_of_y.specified())
+ 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;
@@ -254,7 +257,7 @@ namespace
).max_exit_status())
throw ActionAbortedError("Aborted by hook");
- if (cmdline.a_x_of_y.specified())
+ 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;
}
@@ -274,7 +277,7 @@ namespace
UninstallAction uninstall_action(options);
execute(env, cmdline, id, "clean", uninstall_action);
- if (cmdline.a_x_of_y.specified())
+ 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;
}