diff options
Diffstat (limited to 'lldb/source/Interpreter/CommandObject.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandObject.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index 16c68ec1b22..baf4fcb37c0 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -177,7 +177,7 @@ CommandObject::ParseOptions if (options != NULL) { Error error; - options->Reset(); + options->NotifyOptionParsingStarting(); // ParseOptions calls getopt_long, which always skips the zero'th item in the array and starts at position 1, // so we need to push a dummy value into position zero. @@ -187,7 +187,15 @@ CommandObject::ParseOptions // The "dummy_string" will have already been removed by ParseOptions, // so no need to remove it. - if (error.Fail() || !options->VerifyOptions (result)) + if (error.Success()) + error = options->NotifyOptionParsingFinished(); + + if (error.Success()) + { + if (options->VerifyOptions (result)) + return true; + } + else { const char *error_cstr = error.AsCString(); if (error_cstr) @@ -200,10 +208,9 @@ CommandObject::ParseOptions // No error string, output the usage information into result options->GenerateOptionUsage (result.GetErrorStream(), this); } - // Set the return status to failed (this was an error). - result.SetStatus (eReturnStatusFailed); - return false; } + result.SetStatus (eReturnStatusFailed); + return false; } return true; } |