23 interpreter,
"apropos",
24 "List debugger commands related to a word or subject.", nullptr) {
34 auto search_word = args[0].ref();
35 if (!search_word.empty()) {
42 search_word, commands_found, commands_help,
true,
true,
true,
true);
44 if (commands_found.
GetSize() == 0) {
46 "Try 'help' to see a complete list of "
47 "debugger commands.\n",
51 "The following commands may relate to '%s':\n", args[0].c_str());
53 for (
size_t i = 0; i < commands_found.
GetSize(); ++i)
61 size_t properties_max_len = 0;
62 std::vector<const Property *> properties;
63 const size_t num_properties =
65 for (
const Property *prop : properties) {
67 prop->DumpQualifiedName(qualified_name);
69 std::max(properties_max_len, qualified_name.
GetString().size());
72 if (num_properties == 0) {
74 "No settings found pertaining to '%s'. "
75 "Try 'settings show' to see a complete list of "
76 "debugger settings.\n",
81 "\nThe following settings variables may relate to '{0}': \n\n",
84 const bool dump_qualified_name =
true;
85 for (
size_t i = 0; i < num_properties; ++i)
86 properties[i]->DumpDescription(
94 result.
AppendError(
"'' is not a valid search word.\n");
97 result.
AppendError(
"'apropos' must be called with exactly one argument.\n");
A command line argument class.
size_t GetArgumentCount() const
Gets the number of arguments left in this command object.
~CommandObjectApropos() override
void DoExecute(Args &command, CommandReturnObject &result) override
CommandObjectApropos(CommandInterpreter &interpreter)
CommandObjectParsed(CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
void AddSimpleArgumentList(lldb::CommandArgumentType arg_type, ArgumentRepetitionType repetition_type=eArgRepeatPlain)
CommandInterpreter & m_interpreter
void void AppendError(llvm::StringRef in_string)
void SetStatus(lldb::ReturnStatus status)
void AppendMessageWithFormat(const char *format,...) __attribute__((format(printf
void void AppendMessageWithFormatv(const char *format, Args &&...args)
Stream & GetOutputStream()
size_t Apropos(llvm::StringRef keyword, std::vector< const Property * > &matching_properties) const
llvm::StringRef GetString() const
size_t GetMaxStringLength() const
const char * GetStringAtIndex(size_t idx) const
A class that represents a running process on the host machine.
ReturnStatus
Command Return Status Types.
@ eReturnStatusSuccessFinishResult
@ eReturnStatusSuccessFinishNoResult