rpc: Treat all args after a hidden arg as hidden as well

This commit has no effect right now, but hardens the code for the future
pull/764/head
MarcoFalke 4 years ago
parent a78742830a
commit fa459bdc87
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548

@ -504,7 +504,7 @@ std::string RPCHelpMan::ToString() const
ret += m_name; ret += m_name;
bool was_optional{false}; bool was_optional{false};
for (const auto& arg : m_args) { for (const auto& arg : m_args) {
if (arg.m_hidden) continue; if (arg.m_hidden) break; // Any arg that follows is also hidden
const bool optional = arg.IsOptional(); const bool optional = arg.IsOptional();
ret += " "; ret += " ";
if (optional) { if (optional) {
@ -526,7 +526,7 @@ std::string RPCHelpMan::ToString() const
Sections sections; Sections sections;
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 (arg.m_hidden) continue; if (arg.m_hidden) break; // Any arg that follows is also hidden
if (i == 0) ret += "\nArguments:\n"; if (i == 0) ret += "\nArguments:\n";

Loading…
Cancel
Save