diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp index 87e09e56a7bf..a6c0b49396d0 100644 --- a/lldb/source/Interpreter/Options.cpp +++ b/lldb/source/Interpreter/Options.cpp @@ -1436,10 +1436,11 @@ llvm::Expected Options::Parse(const Args &args, } else { error.SetErrorStringWithFormat("invalid option with value '%i'", val); } - if (error.Fail()) - return error.ToError(); } + if (error.Fail()) + return error.ToError(); + argv.erase(argv.begin(), argv.begin() + OptionParser::GetOptionIndex()); return ReconstituteArgsAfterParsing(argv, args); }