1 //===-- CommandObjectVersion.cpp --------------------------------*- 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 #include "CommandObjectVersion.h"
12 #include "lldb/Interpreter/CommandInterpreter.h"
13 #include "lldb/Interpreter/CommandReturnObject.h"
14 #include "lldb/lldb-private.h"
17 using namespace lldb_private;
19 //-------------------------------------------------------------------------
20 // CommandObjectVersion
21 //-------------------------------------------------------------------------
23 CommandObjectVersion::CommandObjectVersion(CommandInterpreter &interpreter)
24 : CommandObjectParsed(interpreter, "version",
25 "Show the LLDB debugger version.", "version") {}
27 CommandObjectVersion::~CommandObjectVersion() {}
29 bool CommandObjectVersion::DoExecute(Args &args, CommandReturnObject &result) {
30 if (args.GetArgumentCount() == 0) {
31 result.AppendMessageWithFormat("%s\n", lldb_private::GetVersion());
32 result.SetStatus(eReturnStatusSuccessFinishResult);
34 result.AppendError("the version command takes no arguments.");
35 result.SetStatus(eReturnStatusFailed);