LLDB  mainline
CommandObjectVersion.cpp
Go to the documentation of this file.
1 //===-- CommandObjectVersion.cpp --------------------------------*- 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 #include "CommandObjectVersion.h"
10 
13 #include "lldb/lldb-private.h"
14 
15 using namespace lldb;
16 using namespace lldb_private;
17 
18 // CommandObjectVersion
19 
20 CommandObjectVersion::CommandObjectVersion(CommandInterpreter &interpreter)
21  : CommandObjectParsed(interpreter, "version",
22  "Show the LLDB debugger version.", "version") {}
23 
25 
27  if (args.GetArgumentCount() == 0) {
28  result.AppendMessageWithFormat("%s\n", lldb_private::GetVersion());
30  } else {
31  result.AppendError("the version command takes no arguments.");
33  }
34  return true;
35 }
A command line argument class.
Definition: Args.h:32
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
size_t GetArgumentCount() const
Gets the number of arguments left in this command object.
Definition: Args.cpp:254
void AppendMessageWithFormat(const char *format,...) __attribute__((format(printf
bool DoExecute(Args &args, CommandReturnObject &result) override
void void AppendError(llvm::StringRef in_string)
Definition: SBAddress.h:15
void SetStatus(lldb::ReturnStatus status)