]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/source/Commands/CommandObjectVersion.cpp
Merge OpenSSL 1.0.2l.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / source / Commands / CommandObjectVersion.cpp
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/Interpreter/CommandInterpreter.h"
17 #include "lldb/Interpreter/CommandReturnObject.h"
18 #include "lldb/lldb-private.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",
29                           "Show the LLDB debugger version.", "version") {}
30
31 CommandObjectVersion::~CommandObjectVersion() {}
32
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);
37   } else {
38     result.AppendError("the version command takes no arguments.");
39     result.SetStatus(eReturnStatusFailed);
40   }
41   return true;
42 }