17 const char *class_use,
bool is_class,
int class_option,
int key_option,
18 int value_option, uint16_t required_options)
19 : m_is_class(is_class), m_required_options(required_options) {
21 "implementation of a ");
26 "to the implementation of a ");
83 llvm::StringRef option_arg,
89 m_name.assign(std::string(option_arg));
93 m_dict_sp = std::make_shared<StructuredData::Dictionary>();
103 m_dict_sp = std::make_shared<StructuredData::Dictionary>();
105 if (!option_arg.empty()) {
107 std::string opt = option_arg.lower();
109 if (llvm::to_integer(option_arg, d)) {
114 static_cast<uint64_t
>(d));
115 }
else if (llvm::to_float(option_arg, d)) {
117 }
else if (opt ==
"true" || opt ==
"false") {
128 "Value: \"{0}\" missing matching key.", option_arg);
131 llvm_unreachable(
"Unimplemented option");
static llvm::raw_ostream & error(Stream &strm)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
bool Test(ValueType bit) const
Test a single flag bit.
std::string m_key_usage_text
OptionGroupPythonClassWithDict(const char *class_use, bool is_class=true, int class_option='C', int key_option='k', int value_option='v', uint16_t required_options=eScriptClass|ePythonFunction)
OptionDefinition m_option_definition[4]
void OptionParsingStarting(ExecutionContext *execution_context) override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
StructuredData::DictionarySP m_dict_sp
std::string m_class_usage_text
std::string m_current_key
std::string m_value_usage_text
Status OptionParsingFinished(ExecutionContext *execution_context) override
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
static Status static Status FromErrorStringWithFormatv(const char *format, Args &&...args)
A class that represents a running process on the host machine.
OptionValidator * validator
If non-NULL, option is valid iff |validator->IsValid()|, otherwise always valid.
const char * long_option
Full name for this option.
const char * usage_text
Full text explaining what this options does and what (if any) argument to pass it.
bool required
This option is required (in the current usage level).
uint32_t completion_type
The kind of completion for this option.
int option_has_arg
no_argument, required_argument or optional_argument
uint32_t usage_mask
Used to mark options that can be used together.
lldb::CommandArgumentType argument_type
Type of argument this option takes.
OptionEnumValues enum_values
If not empty, an array of enum values.
int short_option
Single character for this option.