Add infrastructure for standardizing arguments for commands and
command options; makes it easier to ensure that the same type of
argument will have the same name everywhere, hooks up help for command
arguments, so that users can ask for help when they are confused about
what an argument should be; puts in the beginnings of the ability to
do tab-completion for certain types of arguments, allows automatic
syntax help generation for commands with arguments, and adds command
arguments into command options help correctly.

Currently only the breakpoint-id and breakpoint-id-range arguments, in
the breakpoint commands, have been hooked up to use the new mechanism.
The next steps will be to fix the command options arguments to use
this mechanism, and to fix the rest of the regular command arguments
to use this mechanism.  Most of the help text is currently missing or
dummy text; this will need to be filled in, and the existing argument
help text will need to be cleaned up a bit (it was thrown in quickly,
mostly for testing purposes).

Help command now works for all argument types, although the help may not
be very helpful yet.

Those commands that take "raw" command strings now indicate it in their
help text.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115318 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectHelp.cpp b/source/Commands/CommandObjectHelp.cpp
index 2d4b9f2..4f8b752 100644
--- a/source/Commands/CommandObjectHelp.cpp
+++ b/source/Commands/CommandObjectHelp.cpp
@@ -95,7 +95,14 @@
                 Stream &output_strm = result.GetOutputStream();
                 if (sub_cmd_obj->GetOptions() != NULL)
                 {
-                    m_interpreter.OutputFormattedHelpText (output_strm, "", "", sub_cmd_obj->GetHelp(), 1);
+                    if (sub_cmd_obj->WantsRawCommandString())
+                    {
+                        std::string help_text (sub_cmd_obj->GetHelp());
+                        help_text.append ("  This command takes 'raw' input (no need to quote stuff).");
+                        m_interpreter.OutputFormattedHelpText (output_strm, "", "", help_text.c_str(), 1);
+                    }
+                    else
+                        m_interpreter.OutputFormattedHelpText (output_strm, "", "", sub_cmd_obj->GetHelp(), 1);
                     output_strm.Printf ("\nSyntax: %s\n", sub_cmd_obj->GetSyntax());
                     sub_cmd_obj->GetOptions()->GenerateOptionUsage (m_interpreter, output_strm, sub_cmd_obj);
                     const char *long_help = sub_cmd_obj->GetHelpLong();
@@ -105,7 +112,14 @@
                 }
                 else if (sub_cmd_obj->IsMultiwordObject())
                 {
-                    m_interpreter.OutputFormattedHelpText (output_strm, "", "", sub_cmd_obj->GetHelp(), 1);
+                    if (sub_cmd_obj->WantsRawCommandString())
+                    {
+                        std::string help_text (sub_cmd_obj->GetHelp());
+                        help_text.append ("  This command takes 'raw' input (no need to quote stuff).");
+                        m_interpreter.OutputFormattedHelpText (output_strm, "", "", help_text.c_str(), 1);
+                    }
+                    else
+                        m_interpreter.OutputFormattedHelpText (output_strm, "", "", sub_cmd_obj->GetHelp(), 1);
                     ((CommandObjectMultiword *) sub_cmd_obj)->GenerateHelpText (result);
                 }
                 else
@@ -114,6 +128,12 @@
                     if ((long_help != NULL)
                         && (strlen (long_help) > 0))
                         output_strm.Printf ("\n%s", long_help);
+                    else if (sub_cmd_obj->WantsRawCommandString())
+                    {
+                        std::string help_text (sub_cmd_obj->GetHelp());
+                        help_text.append ("  This command takes 'raw' input (no need to quote stuff).");
+                        m_interpreter.OutputFormattedHelpText (output_strm, "", "", help_text.c_str(), 1);
+                    }
                     else
                         m_interpreter.OutputFormattedHelpText (output_strm, "", "", sub_cmd_obj->GetHelp(), 1);
                     output_strm.Printf ("\nSyntax: %s\n", sub_cmd_obj->GetSyntax());
@@ -132,10 +152,21 @@
         }
         else
         {
-            result.AppendErrorWithFormat 
-            ("'%s' is not a known command.\nTry 'help' to see a current list of commands.\n",
-             command.GetArgumentAtIndex(0));
-            result.SetStatus (eReturnStatusFailed);
+            // Maybe the user is asking for help about a command argument rather than a command.
+            const CommandArgumentType arg_type = CommandObject::LookupArgumentName (command.GetArgumentAtIndex (0));
+            if (arg_type != eArgTypeLastArg)
+            {
+                Stream &output_strm = result.GetOutputStream ();
+                CommandObject::GetArgumentHelp (output_strm, arg_type, m_interpreter);
+                result.SetStatus (eReturnStatusSuccessFinishNoResult);
+            }
+            else
+            {
+                result.AppendErrorWithFormat 
+                    ("'%s' is not a known command.\nTry 'help' to see a current list of commands.\n",
+                     command.GetArgumentAtIndex(0));
+                result.SetStatus (eReturnStatusFailed);
+            }
         }
     }