diff options
author | Florian Mayer <fmayer@google.com> | 2024-02-23 11:31:14 -0800 |
---|---|---|
committer | Florian Mayer <fmayer@google.com> | 2024-02-23 11:31:14 -0800 |
commit | 886b4bc97b0ed5a5e041a0117a584182fc7989c1 (patch) | |
tree | 43cdc0e15e12c298c09251dda38e834e7e778049 /lldb/source/Interpreter/Options.cpp | |
parent | af8afe08ee20a04b2ccb363cac66aa02cfaecd02 (diff) | |
parent | 8d536f83545f071948888983e2db25ce23a8302d (diff) | |
download | llvm-users/fmayer/sprscudo-allow-to-resize-allocation-ring-buffer.zip llvm-users/fmayer/sprscudo-allow-to-resize-allocation-ring-buffer.tar.gz llvm-users/fmayer/sprscudo-allow-to-resize-allocation-ring-buffer.tar.bz2 |
Created using spr 1.3.4
Diffstat (limited to 'lldb/source/Interpreter/Options.cpp')
-rw-r--r-- | lldb/source/Interpreter/Options.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp index 89fe690..51b7e6b 100644 --- a/lldb/source/Interpreter/Options.cpp +++ b/lldb/source/Interpreter/Options.cpp @@ -1365,3 +1365,16 @@ llvm::Expected<Args> Options::Parse(const Args &args, argv.erase(argv.begin(), argv.begin() + OptionParser::GetOptionIndex()); return ReconstituteArgsAfterParsing(argv, args); } + +llvm::Error lldb_private::CreateOptionParsingError( + llvm::StringRef option_arg, const char short_option, + llvm::StringRef long_option, llvm::StringRef additional_context) { + std::string buffer; + llvm::raw_string_ostream stream(buffer); + stream << "Invalid value ('" << option_arg << "') for -" << short_option; + if (!long_option.empty()) + stream << " (" << long_option << ")"; + if (!additional_context.empty()) + stream << ": " << additional_context; + return llvm::createStringError(llvm::inconvertibleErrorCode(), buffer); +} |