9#ifndef LLDB_INTERPRETER_OPTIONS_H
10#define LLDB_INTERPRETER_OPTIONS_H
22#include "llvm/ADT/ArrayRef.h"
23#include "llvm/ADT/StringRef.h"
88 uint32_t output_max_columns);
91 uint32_t screen_width);
99 return llvm::ArrayRef<OptionDefinition>();
125 llvm::Expected<Args>
Parse(
const Args &args,
128 bool require_validation);
132 std::string &input_line);
135 uint32_t cursor_index);
189 int opt_element_index,
243 llvm::StringRef option_value,
307 llvm::ArrayRef<llvm::StringRef> exclude_long_options);
363 const char short_option,
364 llvm::StringRef long_option = {},
365 llvm::StringRef additional_context = {});
368 "Failed to parse as boolean";
370 "Failed to parse as integer";
static llvm::raw_ostream & error(Stream &strm)
A command line argument class.
"lldb/Utility/ArgCompletionRequest.h"
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
void OptionParsingStarting(ExecutionContext *execution_context) override
std::vector< OptionDefinition > m_option_defs
const OptionGroup * GetGroupWithOption(char short_opt)
std::vector< OptionInfo > OptionInfos
OptionInfos m_option_infos
~OptionGroupOptions() override=default
OptionGroupOptions()=default
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
Status OptionParsingFinished(ExecutionContext *execution_context) override
void Append(OptionGroup *group)
Append options from a OptionGroup class.
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
virtual Status OptionParsingFinished(ExecutionContext *execution_context)
virtual llvm::ArrayRef< OptionDefinition > GetDefinitions()=0
virtual void OptionParsingStarting(ExecutionContext *execution_context)=0
virtual Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context)=0
virtual ~OptionGroup()=default
A command line option parsing protocol class.
bool VerifyOptions(CommandReturnObject &result)
void OptionsSetUnion(const OptionSet &set_a, const OptionSet &set_b, OptionSet &union_set)
virtual void HandleOptionArgumentCompletion(lldb_private::CompletionRequest &request, OptionElementVector &opt_element_vector, int opt_element_index, CommandInterpreter &interpreter)
Handles the generic bits of figuring out whether we are in an option, and if so completing it.
virtual Status OptionParsingFinished(ExecutionContext *execution_context)
void GenerateOptionUsage(Stream &strm, CommandObject &cmd, uint32_t screen_width)
virtual Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context)=0
Set the value of an option.
void OutputFormattedUsageText(Stream &strm, const OptionDefinition &option_def, uint32_t output_max_columns)
uint32_t NumCommandOptions()
virtual void OptionParsingStarting(ExecutionContext *execution_context)=0
void OptionSeen(int short_option)
virtual llvm::ArrayRef< OptionDefinition > GetDefinitions()
Status NotifyOptionParsingFinished(ExecutionContext *execution_context)
bool VerifyPartialOptions(CommandReturnObject &result)
Option * GetLongOptions()
Get the option definitions to use when parsing Args options.
OptionSetVector m_optional_options
void NotifyOptionParsingStarting(ExecutionContext *execution_context)
llvm::Expected< Args > ParseAlias(const Args &args, OptionArgVector *option_arg_vector, std::string &input_line)
std::set< int > OptionSet
std::vector< OptionSet > OptionSetVector
OptionSetVector m_required_options
OptionSetVector & GetOptionalOptions()
size_t OptionsSetDiff(const OptionSet &set_a, const OptionSet &set_b, OptionSet &diffs)
void BuildValidOptionSets()
bool HandleOptionCompletion(lldb_private::CompletionRequest &request, OptionElementVector &option_map, CommandInterpreter &interpreter)
Handles the generic bits of figuring out whether we are in an option, and if so completing it.
bool IsASubset(const OptionSet &set_a, const OptionSet &set_b)
bool SupportsLongOption(const char *long_option)
std::vector< Option > m_getopt_table
llvm::Expected< Args > Parse(const Args &args, ExecutionContext *execution_context, lldb::PlatformSP platform_sp, bool require_validation)
Parse the provided arguments.
OptionSetVector & GetRequiredOptions()
OptionElementVector ParseForCompletion(const Args &args, uint32_t cursor_index)
A stream class that can stream formatted output to a file.
A class that represents a running process on the host machine.
std::vector< OptionArgElement > OptionElementVector
std::shared_ptr< OptionArgVector > OptionArgVectorSP
static constexpr llvm::StringLiteral g_bool_parsing_error_message
static constexpr llvm::StringLiteral g_int_parsing_error_message
llvm::Error CreateOptionParsingError(llvm::StringRef option_arg, const char short_option, llvm::StringRef long_option={}, llvm::StringRef additional_context={})
Creates an error that represents the failure to parse an command line option argument.
static constexpr llvm::StringLiteral g_language_parsing_error_message
std::vector< std::tuple< std::string, int, std::string > > OptionArgVector
std::shared_ptr< lldb_private::Platform > PlatformSP
OptionArgElement(int defs_index, int pos, int arg_pos)
OptionInfo(OptionGroup *g, uint32_t i)
OptionGroup * option_group