1 //===-- CommandObjectHelp.h -------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_CommandObjectHelp_h_
11 #define liblldb_CommandObjectHelp_h_
15 // Other libraries and framework includes
17 #include "lldb/Interpreter/CommandObject.h"
18 #include "lldb/Interpreter/Options.h"
20 namespace lldb_private {
22 //-------------------------------------------------------------------------
24 //-------------------------------------------------------------------------
26 class CommandObjectHelp : public CommandObjectParsed
30 CommandObjectHelp (CommandInterpreter &interpreter);
32 ~CommandObjectHelp() override;
35 HandleCompletion(Args &input,
37 int &cursor_char_position,
38 int match_start_point,
39 int max_return_elements,
41 StringList &matches) override;
44 GenerateAdditionalHelpAvenuesMessage (Stream *s,
46 const char* prefix = nullptr,
47 const char* subcommand = nullptr,
48 bool include_apropos = true,
49 bool include_type_lookup = true);
51 class CommandOptions : public Options
55 CommandOptions (CommandInterpreter &interpreter) :
60 ~CommandOptions() override {}
63 SetOptionValue(uint32_t option_idx, const char *option_arg) override
66 const int short_option = m_getopt_table[option_idx].val;
71 m_show_aliases = false;
74 m_show_user_defined = false;
80 error.SetErrorStringWithFormat ("unrecognized option '%c'", short_option);
88 OptionParsingStarting() override
90 m_show_aliases = true;
91 m_show_user_defined = true;
92 m_show_hidden = false;
95 const OptionDefinition*
96 GetDefinitions() override
98 return g_option_table;
101 // Options table: Required for subclasses of Options.
103 static OptionDefinition g_option_table[];
105 // Instance variables to hold the values for command options.
108 bool m_show_user_defined;
113 GetOptions() override
120 DoExecute(Args& command,
121 CommandReturnObject &result) override;
124 CommandOptions m_options;
127 } // namespace lldb_private
129 #endif // liblldb_CommandObjectHelp_h_