aboutsummaryrefslogtreecommitdiffstats
path: root/source/Commands/CommandObjectApropos.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Commands/CommandObjectApropos.cpp')
-rw-r--r--source/Commands/CommandObjectApropos.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/source/Commands/CommandObjectApropos.cpp b/source/Commands/CommandObjectApropos.cpp
index 957de475569c..7ba0b250fbd5 100644
--- a/source/Commands/CommandObjectApropos.cpp
+++ b/source/Commands/CommandObjectApropos.cpp
@@ -44,7 +44,7 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
const size_t argc = args.GetArgumentCount();
if (argc == 1) {
- auto search_word = args[0].ref;
+ auto search_word = args[0].ref();
if (!search_word.empty()) {
// The bulk of the work must be done inside the Command Interpreter,
// since the command dictionary is private.
@@ -63,13 +63,7 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
if (commands_found.GetSize() > 0) {
result.AppendMessageWithFormat(
"The following commands may relate to '%s':\n", args[0].c_str());
- size_t max_len = 0;
-
- for (size_t i = 0; i < commands_found.GetSize(); ++i) {
- size_t len = strlen(commands_found.GetStringAtIndex(i));
- if (len > max_len)
- max_len = len;
- }
+ const size_t max_len = commands_found.GetMaxStringLength();
for (size_t i = 0; i < commands_found.GetSize(); ++i)
m_interpreter.OutputFormattedHelpText(
@@ -85,7 +79,7 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
const bool dump_qualified_name = true;
result.AppendMessageWithFormatv(
"\nThe following settings variables may relate to '{0}': \n\n",
- args[0].ref);
+ args[0].ref());
for (size_t i = 0; i < num_properties; ++i)
properties[i]->DumpDescription(
m_interpreter, result.GetOutputStream(), 0, dump_qualified_name);