blob: 3b75c870a34077f205b5277d1a61fed72be9976f [file] [log] [blame]
Chris Lattner24943d22010-06-08 16:52:24 +00001//===-- CommandObjectSettings.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 "CommandObjectSettings.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
19using namespace lldb;
20using namespace lldb_private;
21
22//-------------------------------------------------------------------------
23// CommandObjectSettings
24//-------------------------------------------------------------------------
25
26CommandObjectSettings::CommandObjectSettings () :
27 CommandObject ("settings",
28 "Lists the debugger settings variables available to the user to 'set' or 'show'.",
29 "settings")
30{
31}
32
33CommandObjectSettings::~CommandObjectSettings()
34{
35}
36
37
38bool
39CommandObjectSettings::Execute
40(
Greg Clayton63094e02010-06-23 01:19:29 +000041 CommandInterpreter &interpreter,
Chris Lattner24943d22010-06-08 16:52:24 +000042 Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +000043 CommandReturnObject &result
44)
45{
46 CommandInterpreter::VariableMap::iterator pos;
47
48 if (command.GetArgumentCount() != 0)
49 {
50 result.AppendError ("'settings' does not take any arguments");
51 result.SetStatus (eReturnStatusFailed);
52 }
53 else
54 {
Greg Clayton63094e02010-06-23 01:19:29 +000055 interpreter.ShowVariableHelp (result);
Chris Lattner24943d22010-06-08 16:52:24 +000056 result.SetStatus (eReturnStatusSuccessFinishNoResult);
57 }
58
59 return result.Succeeded();
60}
61