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/CommandObjectMultiword.cpp b/source/Commands/CommandObjectMultiword.cpp
index 0a2987c..9530adf 100644
--- a/source/Commands/CommandObjectMultiword.cpp
+++ b/source/Commands/CommandObjectMultiword.cpp
@@ -26,12 +26,13 @@
 
 CommandObjectMultiword::CommandObjectMultiword
 (
+    CommandInterpreter &interpreter,
     const char *name,
     const char *help,
     const char *syntax,
     uint32_t flags
 ) :
-    CommandObject (name, help, syntax, flags)
+    CommandObject (interpreter, name, help, syntax, flags)
 {
 }
 
@@ -82,7 +83,6 @@
 bool
 CommandObjectMultiword::LoadSubCommand 
 (
-    CommandInterpreter &interpreter, 
     const char *name,
     const CommandObjectSP& cmd_obj
 )
@@ -94,7 +94,7 @@
     if (pos == m_subcommand_dict.end())
     {
         m_subcommand_dict[name] = cmd_obj;
-        interpreter.CrossRegisterCommand (name, GetCommandName());
+        m_interpreter.CrossRegisterCommand (name, GetCommandName());
     }
     else
         success = false;
@@ -105,7 +105,6 @@
 bool
 CommandObjectMultiword::Execute
 (
-    CommandInterpreter &interpreter,
     Args& args,
     CommandReturnObject &result
 )
@@ -113,7 +112,7 @@
     const size_t argc = args.GetArgumentCount();
     if (argc == 0)
     {
-        GenerateHelpText (interpreter, result);
+        GenerateHelpText (result);
     }
     else
     {
@@ -123,7 +122,7 @@
         {
             if (::strcasecmp (sub_command, "help") == 0)
             {
-                GenerateHelpText (interpreter, result);
+                GenerateHelpText (result);
             }
             else if (!m_subcommand_dict.empty())
             {
@@ -136,7 +135,7 @@
 
                     args.Shift();
 
-                    sub_cmd_obj->ExecuteWithOptions (interpreter, args, result);
+                    sub_cmd_obj->ExecuteWithOptions (args, result);
                 }
                 else
                 {
@@ -179,7 +178,7 @@
 }
 
 void
-CommandObjectMultiword::GenerateHelpText (CommandInterpreter &interpreter, CommandReturnObject &result)
+CommandObjectMultiword::GenerateHelpText (CommandReturnObject &result)
 {
     // First time through here, generate the help text for the object and
     // push it to the return result object as well
@@ -188,7 +187,7 @@
     output_stream.PutCString ("The following subcommands are supported:\n\n");
 
     CommandMap::iterator pos;
-    uint32_t max_len = interpreter.FindLongestCommandWord (m_subcommand_dict);
+    uint32_t max_len = m_interpreter.FindLongestCommandWord (m_subcommand_dict);
 
     if (max_len)
         max_len += 4; // Indent the output by 4 spaces.
@@ -197,11 +196,11 @@
     {
         std::string indented_command ("    ");
         indented_command.append (pos->first);
-        interpreter.OutputFormattedHelpText (result.GetOutputStream(), 
-                                             indented_command.c_str(),
-                                             "--", 
-                                             pos->second->GetHelp(), 
-                                             max_len);
+        m_interpreter.OutputFormattedHelpText (result.GetOutputStream(), 
+                                               indented_command.c_str(),
+                                               "--", 
+                                               pos->second->GetHelp(), 
+                                               max_len);
     }
 
     output_stream.PutCString ("\nFor more help on any particular subcommand, type 'help <command> <subcommand>'.\n");
@@ -212,7 +211,6 @@
 int
 CommandObjectMultiword::HandleCompletion
 (
-    CommandInterpreter &interpreter,
     Args &input,
     int &cursor_index,
     int &cursor_char_position,
@@ -245,8 +243,8 @@
                 input.Shift();
                 cursor_char_position = 0;
                 input.AppendArgument ("");
-                return cmd_obj->HandleCompletion (interpreter, 
-                                                  input, cursor_index, 
+                return cmd_obj->HandleCompletion (input, 
+                                                  cursor_index, 
                                                   cursor_char_position, 
                                                   match_start_point,
                                                   max_return_elements,
@@ -273,8 +271,7 @@
             matches.DeleteStringAtIndex(0);
             input.Shift();
             cursor_index--;
-            return sub_command_object->HandleCompletion (interpreter, 
-                                                         input, 
+            return sub_command_object->HandleCompletion (input, 
                                                          cursor_index, 
                                                          cursor_char_position, 
                                                          match_start_point,