diff options
author | Enrico Granata <granata.enrico@gmail.com> | 2011-07-07 00:38:40 +0000 |
---|---|---|
committer | Enrico Granata <granata.enrico@gmail.com> | 2011-07-07 00:38:40 +0000 |
commit | 82a7d9834286acc17d9b36851c065cadec61d36f (patch) | |
tree | 73211af609bb2b758de71cf16ce41d58e37d5269 /lldb/source/Interpreter/CommandInterpreter.cpp | |
parent | 2bbdc0bcda6e50ebfe701e909caf057e44048832 (diff) | |
download | bcm5719-llvm-82a7d9834286acc17d9b36851c065cadec61d36f.tar.gz bcm5719-llvm-82a7d9834286acc17d9b36851c065cadec61d36f.zip |
new detailed descriptions for type summary add and type format add
some changes to the help system code for better display of long help text
-p and -r flags now also work for type format add
llvm-svn: 134574
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index bcbd5f8bfcf..8e499d7de43 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -2014,6 +2014,49 @@ CommandInterpreter::OutputFormattedHelpText (Stream &strm, } void +CommandInterpreter::OutputHelpText (Stream &strm, + const char *word_text, + const char *separator, + const char *help_text, + uint32_t max_word_len) +{ + int indent_size = max_word_len + strlen (separator) + 2; + + strm.IndentMore (indent_size); + + StreamString text_strm; + text_strm.Printf ("%-*s %s %s", max_word_len, word_text, separator, help_text); + + const uint32_t max_columns = m_debugger.GetTerminalWidth(); + bool first_line = true; + + size_t len = text_strm.GetSize(); + const char *text = text_strm.GetData(); + + uint32_t chars_left = max_columns; + + for (uint32_t i = 0; i < len; i++) + { + if ((text[i] == ' ' && ::strchr((text+i+1), ' ') && chars_left < ::strchr((text+i+1), ' ')-(text+i)) || text[i] == '\n') + { + first_line = false; + chars_left = max_columns - indent_size; + strm.EOL(); + strm.Indent(); + } + else + { + strm.PutChar(text[i]); + chars_left--; + } + + } + + strm.EOL(); + strm.IndentLess(indent_size); +} + +void CommandInterpreter::AproposAllSubCommands (CommandObject *cmd_obj, const char *prefix, const char *search_word, StringList &commands_found, StringList &commands_help) { |