If you try to auto-complete "target symbols<TAB>" you get "target symbolsadd" instead of "target symbols ".

Fix this by returning the fact that the "symbols" word is complete if there is nothing else to complete after the "symbols" word.

<rdar://problem/19164599>

llvm-svn: 230408
diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp
index 69b178d..d558a06 100644
--- a/lldb/source/Commands/CommandObjectMultiword.cpp
+++ b/lldb/source/Commands/CommandObjectMultiword.cpp
@@ -251,23 +251,27 @@
                                                           &temp_matches);
             if (cmd_obj != NULL)
             {
-                matches.DeleteStringAtIndex (0);
-                input.Shift();
-                cursor_char_position = 0;
-                input.AppendArgument ("");
-                return cmd_obj->HandleCompletion (input, 
-                                                  cursor_index, 
-                                                  cursor_char_position, 
-                                                  match_start_point,
-                                                  max_return_elements,
-                                                  word_complete, 
-                                                  matches);
+                if (input.GetArgumentCount() == 1)
+                {
+                    word_complete = true;
+                }
+                else
+                {
+                    matches.DeleteStringAtIndex (0);
+                    input.Shift();
+                    cursor_char_position = 0;
+                    input.AppendArgument ("");
+                    return cmd_obj->HandleCompletion (input,
+                                                      cursor_index,
+                                                      cursor_char_position,
+                                                      match_start_point,
+                                                      max_return_elements,
+                                                      word_complete,
+                                                      matches);
+                }
             }
-            else
-                return matches.GetSize();
         }
-        else
-            return matches.GetSize();
+        return matches.GetSize();
     }
     else
     {