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"
14 // Other libraries and framework includes
16 #include "lldb/Interpreter/CommandInterpreter.h"
17 #include "lldb/Interpreter/CommandReturnObject.h"
18 #include "lldb/lldb-private.h"
21 using namespace lldb_private;
23 //-------------------------------------------------------------------------
24 // CommandObjectVersion
25 //-------------------------------------------------------------------------
27 CommandObjectVersion::CommandObjectVersion(CommandInterpreter &interpreter)
28 : CommandObjectParsed(interpreter, "version",
29 "Show the LLDB debugger version.", "version") {}
31 CommandObjectVersion::~CommandObjectVersion() {}
33 bool CommandObjectVersion::DoExecute(Args &args, CommandReturnObject &result) {
34 if (args.GetArgumentCount() == 0) {
35 result.AppendMessageWithFormat("%s\n", lldb_private::GetVersion());
36 result.SetStatus(eReturnStatusSuccessFinishResult);
38 result.AppendError("the version command takes no arguments.");
39 result.SetStatus(eReturnStatusFailed);