Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/util.cpp
Show First 20 Lines • Show All 513 Lines • ▼ Show 20 Lines | std::string RPCHelpMan::ToString() const { | ||||
for (size_t i{0}; i < m_args.size(); ++i) { | for (size_t i{0}; i < m_args.size(); ++i) { | ||||
const auto &arg = m_args.at(i); | const auto &arg = m_args.at(i); | ||||
if (i == 0) { | if (i == 0) { | ||||
ret += "\nArguments:\n"; | ret += "\nArguments:\n"; | ||||
} | } | ||||
// Push named argument name and description | // Push named argument name and description | ||||
sections.m_sections.emplace_back(std::to_string(i + 1) + ". " + | sections.m_sections.emplace_back(::ToString(i + 1) + ". " + | ||||
arg.GetFirstName(), | arg.GetFirstName(), | ||||
arg.ToDescriptionString()); | arg.ToDescriptionString()); | ||||
sections.m_max_pad = std::max(sections.m_max_pad, | sections.m_max_pad = std::max(sections.m_max_pad, | ||||
sections.m_sections.back().m_left.size()); | sections.m_sections.back().m_left.size()); | ||||
// Recursively push nested args | // Recursively push nested args | ||||
sections.Push(arg); | sections.Push(arg); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 363 Lines • Show Last 20 Lines |