LLDB mainline
CommandObjectVersion.h
Go to the documentation of this file.
1//===-- CommandObjectVersion.h ----------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_SOURCE_COMMANDS_COMMANDOBJECTVERSION_H
10#define LLDB_SOURCE_COMMANDS_COMMANDOBJECTVERSION_H
11
15
16namespace lldb_private {
17
19public:
21
23
24 class CommandOptions : public Options {
25 public:
26 CommandOptions() = default;
27
28 ~CommandOptions() override = default;
29
30 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
31 ExecutionContext *execution_context) override {
33 const int short_option = m_getopt_table[option_idx].val;
34
35 switch (short_option) {
36 case 'v':
37 verbose = true;
38 break;
39 default:
40 llvm_unreachable("Unimplemented option");
41 }
42
43 return error;
44 }
45
46 void OptionParsingStarting(ExecutionContext *execution_context) override {
47 verbose = false;
48 }
49
50 llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
51
52 bool verbose;
53 };
54
55 Options *GetOptions() override { return &m_options; }
56
57protected:
58 void DoExecute(Args &args, CommandReturnObject &result) override;
59
60private:
62};
63
64} // namespace lldb_private
65
66#endif // LLDB_SOURCE_COMMANDS_COMMANDOBJECTVERSION_H
static llvm::raw_ostream & error(Stream &strm)
A command line argument class.
Definition Args.h:33
CommandObjectParsed(CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
void OptionParsingStarting(ExecutionContext *execution_context) override
void DoExecute(Args &args, CommandReturnObject &result) override
CommandObjectVersion(CommandInterpreter &interpreter)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A command line option parsing protocol class.
Definition Options.h:58
std::vector< Option > m_getopt_table
Definition Options.h:198
An error handling class.
Definition Status.h:118
A class that represents a running process on the host machine.