1 //===-- 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 
19 using namespace lldb;
20 using namespace lldb_private;
21 
22 //-------------------------------------------------------------------------
23 // CommandObjectSettings
24 //-------------------------------------------------------------------------
25 
26 CommandObjectSettings::CommandObjectSettings () :
27     CommandObject ("settings",
28                    "Lists the debugger settings variables available to the user to 'set' or 'show'.",
29                    "settings")
30 {
31 }
32 
33 CommandObjectSettings::~CommandObjectSettings()
34 {
35 }
36 
37 
38 bool
39 CommandObjectSettings::Execute
40 (
41     Args& command,
42     CommandContext *context,
43     CommandInterpreter *interpreter,
44     CommandReturnObject &result
45 )
46 {
47     CommandInterpreter::VariableMap::iterator pos;
48 
49     if (command.GetArgumentCount() != 0)
50     {
51         result.AppendError ("'settings' does not take any arguments");
52         result.SetStatus (eReturnStatusFailed);
53     }
54     else
55     {
56         interpreter->ShowVariableHelp (result);
57         result.SetStatus (eReturnStatusSuccessFinishNoResult);
58     }
59 
60     return result.Succeeded();
61 }
62 
63