[Lldb-commits] [lldb] r147540 - in /lldb/trunk/source/Interpreter: CommandObject.cpp Options.cpp

Sean Callanan scallanan at apple.com
Wed Jan 4 11:11:25 PST 2012


Author: spyffe
Date: Wed Jan  4 13:11:25 2012
New Revision: 147540

URL: http://llvm.org/viewvc/llvm-project?rev=147540&view=rev
Log:
Fixed the help text for raw commands like "expr"
to include -- in sample command lines.  Now LLDB
prints

  expression [-f <format>] -- <expr>

instead of

  expression [-f <format>] <expr>

and also adds a new example line:

  expression <expr>

to show that in the absense of arguments the --
can be ommitted.

Modified:
    lldb/trunk/source/Interpreter/CommandObject.cpp
    lldb/trunk/source/Interpreter/Options.cpp

Modified: lldb/trunk/source/Interpreter/CommandObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandObject.cpp?rev=147540&r1=147539&r2=147540&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandObject.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandObject.cpp Wed Jan  4 13:11:25 2012
@@ -89,6 +89,8 @@
         if (m_arguments.size() > 0)
         {
             syntax_str.Printf (" ");
+            if (WantsRawCommandString())
+                syntax_str.Printf("-- ");
             GetFormattedCommandArguments (syntax_str);
         }
         m_cmd_syntax = syntax_str.GetData ();

Modified: lldb/trunk/source/Interpreter/Options.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Options.cpp?rev=147540&r1=147539&r2=147540&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/Options.cpp (original)
+++ lldb/trunk/source/Interpreter/Options.cpp Wed Jan  4 13:11:25 2012
@@ -555,9 +555,24 @@
                 }
             }
         }
+        
         if (arguments_str.GetSize() > 0)
+        {
+            if (cmd->WantsRawCommandString())
+                strm.Printf(" --");
+            
             strm.Printf (" %s", arguments_str.GetData());
+        }
     }
+    
+    if (cmd->WantsRawCommandString() &&
+        arguments_str.GetSize() > 0)
+    {        
+        strm.PutChar('\n');
+        strm.Indent(name);
+        strm.Printf(" %s", arguments_str.GetData());
+    }
+    
     strm.Printf ("\n\n");
 
     // Now print out all the detailed information about the various options:  long form, short form and help text:





More information about the lldb-commits mailing list