diff options
author | Michael Sartain <mikesart@valvesoftware.com> | 2013-07-09 23:22:53 +0000 |
---|---|---|
committer | Michael Sartain <mikesart@valvesoftware.com> | 2013-07-09 23:22:53 +0000 |
commit | 6098617412b902097dee0b278d1dd552fcee89ba (patch) | |
tree | 0c1c6145640268760f556651ad23b28178edfdb3 /lldb | |
parent | ebcad2e0633b3750fdec1e740ed0deb3816bdc38 (diff) | |
download | bcm5719-llvm-6098617412b902097dee0b278d1dd552fcee89ba.tar.gz bcm5719-llvm-6098617412b902097dee0b278d1dd552fcee89ba.zip |
Add silent option to command source.
Patch from Matthew Sorrels
llvm-svn: 185983
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/source/Commands/CommandObjectCommands.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index 931decd47a2..4699aa6d9c4 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -333,6 +333,11 @@ protected: if (!success) error.SetErrorStringWithFormat("invalid value for stop-on-continue: %s", option_arg); break; + case 's': + m_silent_run = Args::StringToBoolean(option_arg, true, &success); + if (!success) + error.SetErrorStringWithFormat("invalid value for silent-run: %s", option_arg); + break; default: error.SetErrorStringWithFormat ("unrecognized option '%c'", short_option); break; @@ -345,6 +350,7 @@ protected: OptionParsingStarting () { m_stop_on_error.Clear(); + m_silent_run = false; m_stop_on_continue = true; } @@ -361,6 +367,7 @@ protected: // Instance variables to hold the values for command options. OptionValueBoolean m_stop_on_error; + bool m_silent_run; bool m_stop_on_continue; }; @@ -376,7 +383,7 @@ protected: FileSpec cmd_file (filename, true); ExecutionContext *exe_ctx = NULL; // Just use the default context. - bool echo_commands = true; + bool echo_commands = !m_options.m_silent_run; bool print_results = true; bool stop_on_error = m_options.m_stop_on_error.OptionWasSet() ? (bool)m_options.m_stop_on_error : m_interpreter.GetStopCmdSourceOnError(); @@ -405,6 +412,7 @@ CommandObjectCommandsSource::CommandOptions::g_option_table[] = { { LLDB_OPT_SET_ALL, false, "stop-on-error", 'e', required_argument, NULL, 0, eArgTypeBoolean, "If true, stop executing commands on error."}, { LLDB_OPT_SET_ALL, false, "stop-on-continue", 'c', required_argument, NULL, 0, eArgTypeBoolean, "If true, stop executing commands on continue."}, +{ LLDB_OPT_SET_ALL, false, "silent-run", 's', required_argument, NULL, 0, eArgTypeBoolean, "If true don't echo commands while executing."}, { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL } }; |