1 //===-- CommandObjectVersion.cpp --------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "CommandObjectVersion.h" 11 12 // C Includes 13 // C++ Includes 14 // Other libraries and framework includes 15 // Project includes 16 #include "lldb/lldb-private.h" 17 #include "lldb/Interpreter/CommandInterpreter.h" 18 #include "lldb/Interpreter/CommandReturnObject.h" 19 20 using namespace lldb; 21 using namespace lldb_private; 22 23 //------------------------------------------------------------------------- 24 // CommandObjectVersion 25 //------------------------------------------------------------------------- 26 27 CommandObjectVersion::CommandObjectVersion(CommandInterpreter &interpreter) 28 : CommandObjectParsed(interpreter, "version", "Show the LLDB debugger version.", "version") 29 { 30 } 31 32 CommandObjectVersion::~CommandObjectVersion () 33 { 34 } 35 36 bool 37 CommandObjectVersion::DoExecute (Args& args, CommandReturnObject &result) 38 { 39 if (args.GetArgumentCount() == 0) 40 { 41 result.AppendMessageWithFormat ("%s\n", lldb_private::GetVersion()); 42 result.SetStatus (eReturnStatusSuccessFinishResult); 43 } 44 else 45 { 46 result.AppendError("the version command takes no arguments."); 47 result.SetStatus (eReturnStatusFailed); 48 } 49 return true; 50 } 51 52