1ac7ddfbfSEd Maste //===-- CommandObjectVersion.cpp --------------------------------*- C++ -*-===// 2ac7ddfbfSEd Maste // 3ac7ddfbfSEd Maste // The LLVM Compiler Infrastructure 4ac7ddfbfSEd Maste // 5ac7ddfbfSEd Maste // This file is distributed under the University of Illinois Open Source 6ac7ddfbfSEd Maste // License. See LICENSE.TXT for details. 7ac7ddfbfSEd Maste // 8ac7ddfbfSEd Maste //===----------------------------------------------------------------------===// 9ac7ddfbfSEd Maste 10ac7ddfbfSEd Maste #include "CommandObjectVersion.h" 11ac7ddfbfSEd Maste 12ac7ddfbfSEd Maste #include "lldb/Interpreter/CommandInterpreter.h" 13ac7ddfbfSEd Maste #include "lldb/Interpreter/CommandReturnObject.h" 14435933ddSDimitry Andric #include "lldb/lldb-private.h" 15ac7ddfbfSEd Maste 16ac7ddfbfSEd Maste using namespace lldb; 17ac7ddfbfSEd Maste using namespace lldb_private; 18ac7ddfbfSEd Maste 19ac7ddfbfSEd Maste //------------------------------------------------------------------------- 20ac7ddfbfSEd Maste // CommandObjectVersion 21ac7ddfbfSEd Maste //------------------------------------------------------------------------- 22ac7ddfbfSEd Maste CommandObjectVersion(CommandInterpreter & interpreter)234bb0738eSEd MasteCommandObjectVersion::CommandObjectVersion(CommandInterpreter &interpreter) 24435933ddSDimitry Andric : CommandObjectParsed(interpreter, "version", 25435933ddSDimitry Andric "Show the LLDB debugger version.", "version") {} 26ac7ddfbfSEd Maste ~CommandObjectVersion()27435933ddSDimitry AndricCommandObjectVersion::~CommandObjectVersion() {} 28ac7ddfbfSEd Maste DoExecute(Args & args,CommandReturnObject & result)29435933ddSDimitry Andricbool CommandObjectVersion::DoExecute(Args &args, CommandReturnObject &result) { 30435933ddSDimitry Andric if (args.GetArgumentCount() == 0) { 31ac7ddfbfSEd Maste result.AppendMessageWithFormat("%s\n", lldb_private::GetVersion()); 32ac7ddfbfSEd Maste result.SetStatus(eReturnStatusSuccessFinishResult); 33435933ddSDimitry Andric } else { 34ac7ddfbfSEd Maste result.AppendError("the version command takes no arguments."); 35ac7ddfbfSEd Maste result.SetStatus(eReturnStatusFailed); 36ac7ddfbfSEd Maste } 37ac7ddfbfSEd Maste return true; 38ac7ddfbfSEd Maste } 39