131c39dacSJohnny Chen //===-- CommandObjectVersion.cpp --------------------------------*- C++ -*-===// 231c39dacSJohnny Chen // 331c39dacSJohnny Chen // The LLVM Compiler Infrastructure 431c39dacSJohnny Chen // 531c39dacSJohnny Chen // This file is distributed under the University of Illinois Open Source 631c39dacSJohnny Chen // License. See LICENSE.TXT for details. 731c39dacSJohnny Chen // 831c39dacSJohnny Chen //===----------------------------------------------------------------------===// 931c39dacSJohnny Chen 1031c39dacSJohnny Chen #include "CommandObjectVersion.h" 1131c39dacSJohnny Chen 1231c39dacSJohnny Chen // C Includes 1331c39dacSJohnny Chen // C++ Includes 1431c39dacSJohnny Chen // Other libraries and framework includes 1531c39dacSJohnny Chen // Project includes 1631c39dacSJohnny Chen #include "lldb/Interpreter/CommandInterpreter.h" 1731c39dacSJohnny Chen #include "lldb/Interpreter/CommandReturnObject.h" 18*b9c1b51eSKate Stone #include "lldb/lldb-private.h" 1931c39dacSJohnny Chen 2031c39dacSJohnny Chen using namespace lldb; 2131c39dacSJohnny Chen using namespace lldb_private; 2231c39dacSJohnny Chen 2331c39dacSJohnny Chen //------------------------------------------------------------------------- 2431c39dacSJohnny Chen // CommandObjectVersion 2531c39dacSJohnny Chen //------------------------------------------------------------------------- 2631c39dacSJohnny Chen 277428a18cSKate Stone CommandObjectVersion::CommandObjectVersion(CommandInterpreter &interpreter) 28*b9c1b51eSKate Stone : CommandObjectParsed(interpreter, "version", 29*b9c1b51eSKate Stone "Show the LLDB debugger version.", "version") {} 3031c39dacSJohnny Chen 31*b9c1b51eSKate Stone CommandObjectVersion::~CommandObjectVersion() {} 3231c39dacSJohnny Chen 33*b9c1b51eSKate Stone bool CommandObjectVersion::DoExecute(Args &args, CommandReturnObject &result) { 34*b9c1b51eSKate Stone if (args.GetArgumentCount() == 0) { 3585e8b814SJim Ingham result.AppendMessageWithFormat("%s\n", lldb_private::GetVersion()); 3631c39dacSJohnny Chen result.SetStatus(eReturnStatusSuccessFinishResult); 37*b9c1b51eSKate Stone } else { 3857ee3067SGreg Clayton result.AppendError("the version command takes no arguments."); 3957ee3067SGreg Clayton result.SetStatus(eReturnStatusFailed); 4057ee3067SGreg Clayton } 4131c39dacSJohnny Chen return true; 4231c39dacSJohnny Chen } 43