Fixed the way set/show variables were being accessed to being natively 
accessed by the objects that own the settings. The previous approach wasn't
very usable and made for a lot of unnecessary code just to access variables
that were already owned by the objects.

While I fixed those things, I saw that CommandObject objects should really
have a reference to their command interpreter so they can access the terminal
with if they want to output usaage. Fixed up all CommandObjects to take
an interpreter and cleaned up the API to not need the interpreter to be
passed in.

Fixed the disassemble command to output the usage if no options are passed
down and arguments are passed (all disassebmle variants take options, there
are no "args only").



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114252 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectFile.cpp b/source/Commands/CommandObjectFile.cpp
index 54bd975..4a560ab 100644
--- a/source/Commands/CommandObjectFile.cpp
+++ b/source/Commands/CommandObjectFile.cpp
@@ -85,8 +85,9 @@
 // CommandObjectFile
 //-------------------------------------------------------------------------
 
-CommandObjectFile::CommandObjectFile() :
-    CommandObject ("file",
+CommandObjectFile::CommandObjectFile(CommandInterpreter &interpreter) :
+    CommandObject (interpreter,
+                   "file",
                    "Set the file to be used as the main executable by the debugger.",
                    "file [<cmd-options>] <filename>")
 {
@@ -105,7 +106,6 @@
 bool
 CommandObjectFile::Execute
 (
-    CommandInterpreter &interpreter,
     Args& command,
     CommandReturnObject &result
 )
@@ -127,7 +127,7 @@
         TargetSP target_sp;
 
         ArchSpec arch = m_options.m_arch;
-        Debugger &debugger = interpreter.GetDebugger();
+        Debugger &debugger = m_interpreter.GetDebugger();
         Error error = debugger.GetTargetList().CreateTarget (debugger, file_spec, m_options.m_arch, NULL, true, target_sp);
 
         if (target_sp)
@@ -152,27 +152,28 @@
 }
 
 int
-CommandObjectFile::HandleArgumentCompletion (CommandInterpreter &interpreter,
-                              Args &input,
-                              int &cursor_index,
-                              int &cursor_char_position,
-                              OptionElementVector &opt_element_vector,
-                              int match_start_point,
-                              int max_return_elements,
-                              bool &word_complete,
-                              StringList &matches)
+CommandObjectFile::HandleArgumentCompletion 
+(
+    Args &input,
+    int &cursor_index,
+    int &cursor_char_position,
+    OptionElementVector &opt_element_vector,
+    int match_start_point,
+    int max_return_elements,
+    bool &word_complete,
+    StringList &matches
+)
 {
-        std::string completion_str (input.GetArgumentAtIndex(cursor_index));
-        completion_str.erase (cursor_char_position);
+    std::string completion_str (input.GetArgumentAtIndex(cursor_index));
+    completion_str.erase (cursor_char_position);
 
-        CommandCompletions::InvokeCommonCompletionCallbacks (interpreter, 
-                                                             CommandCompletions::eDiskFileCompletion,
-                                                             completion_str.c_str(),
-                                                             match_start_point,
-                                                             max_return_elements,
-                                                             NULL,
-                                                             word_complete,
-                                                             matches);
-        return matches.GetSize();
-    
+    CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter, 
+                                                         CommandCompletions::eDiskFileCompletion,
+                                                         completion_str.c_str(),
+                                                         match_start_point,
+                                                         max_return_elements,
+                                                         NULL,
+                                                         word_complete,
+                                                         matches);
+    return matches.GetSize();
 }