diff options
Diffstat (limited to 'lldb/source/Interpreter/CommandObject.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandObject.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index 559e2e7..7008253 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -120,17 +120,24 @@ bool CommandObject::ParseOptions(Args &args, CommandReturnObject &result) { if (args_or) { args = std::move(*args_or); error = options->NotifyOptionParsingFinished(&exe_ctx); - } else + } else { error = Status::FromError(args_or.takeError()); + } - if (error.Success()) { - if (options->VerifyOptions(result)) - return true; - } else { + if (error.Fail()) { result.SetError(error.takeError()); + result.SetStatus(eReturnStatusFailed); + return false; } - result.SetStatus(eReturnStatusFailed); - return false; + + if (llvm::Error error = options->VerifyOptions()) { + result.SetError(std::move(error)); + result.SetStatus(eReturnStatusFailed); + return false; + } + + result.SetStatus(eReturnStatusSuccessFinishNoResult); + return true; } return true; } |