xref: /openbsd-src/gnu/llvm/lldb/source/Commands/CommandObjectVersion.cpp (revision f6aab3d83b51b91c24247ad2c2573574de475a82)
1dda28197Spatrick //===-- CommandObjectVersion.cpp ------------------------------------------===//
2061da546Spatrick //
3061da546Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4061da546Spatrick // See https://llvm.org/LICENSE.txt for license information.
5061da546Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6061da546Spatrick //
7061da546Spatrick //===----------------------------------------------------------------------===//
8061da546Spatrick 
9061da546Spatrick #include "CommandObjectVersion.h"
10061da546Spatrick 
11061da546Spatrick #include "lldb/Interpreter/CommandReturnObject.h"
12*f6aab3d8Srobert #include "lldb/Version/Version.h"
13061da546Spatrick 
14061da546Spatrick using namespace lldb;
15061da546Spatrick using namespace lldb_private;
16061da546Spatrick 
17061da546Spatrick // CommandObjectVersion
18061da546Spatrick 
CommandObjectVersion(CommandInterpreter & interpreter)19061da546Spatrick CommandObjectVersion::CommandObjectVersion(CommandInterpreter &interpreter)
20061da546Spatrick     : CommandObjectParsed(interpreter, "version",
21061da546Spatrick                           "Show the LLDB debugger version.", "version") {}
22061da546Spatrick 
23be691f3bSpatrick CommandObjectVersion::~CommandObjectVersion() = default;
24061da546Spatrick 
DoExecute(Args & args,CommandReturnObject & result)25061da546Spatrick bool CommandObjectVersion::DoExecute(Args &args, CommandReturnObject &result) {
26061da546Spatrick   result.AppendMessageWithFormat("%s\n", lldb_private::GetVersion());
27061da546Spatrick   result.SetStatus(eReturnStatusSuccessFinishResult);
28061da546Spatrick   return true;
29061da546Spatrick }
30