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/lldb-private.h" 1731c39dacSJohnny Chen #include "lldb/Interpreter/CommandInterpreter.h" 1831c39dacSJohnny Chen #include "lldb/Interpreter/CommandReturnObject.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 27*7428a18cSKate Stone CommandObjectVersion::CommandObjectVersion(CommandInterpreter &interpreter) 28*7428a18cSKate Stone : CommandObjectParsed(interpreter, "version", "Show the LLDB debugger version.", "version") 2931c39dacSJohnny Chen { 3031c39dacSJohnny Chen } 3131c39dacSJohnny Chen 3231c39dacSJohnny Chen CommandObjectVersion::~CommandObjectVersion () 3331c39dacSJohnny Chen { 3431c39dacSJohnny Chen } 3531c39dacSJohnny Chen 3631c39dacSJohnny Chen bool 375a988416SJim Ingham CommandObjectVersion::DoExecute (Args& args, CommandReturnObject &result) 3831c39dacSJohnny Chen { 3957ee3067SGreg Clayton if (args.GetArgumentCount() == 0) 4057ee3067SGreg Clayton { 4185e8b814SJim Ingham result.AppendMessageWithFormat ("%s\n", lldb_private::GetVersion()); 4231c39dacSJohnny Chen result.SetStatus (eReturnStatusSuccessFinishResult); 4357ee3067SGreg Clayton } 4457ee3067SGreg Clayton else 4557ee3067SGreg Clayton { 4657ee3067SGreg Clayton result.AppendError("the version command takes no arguments."); 4757ee3067SGreg Clayton result.SetStatus (eReturnStatusFailed); 4857ee3067SGreg Clayton } 4931c39dacSJohnny Chen return true; 5031c39dacSJohnny Chen } 5131c39dacSJohnny Chen 52