Skip to content

Commit

Permalink
rpc: Treat all args after a hidden arg as hidden as well
Browse files Browse the repository at this point in the history
This commit has no effect right now, but hardens the code for the future
  • Loading branch information
MarcoFalke committed Aug 2, 2020
1 parent a787428 commit fa459bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rpc/util.cpp
Expand Up @@ -504,7 +504,7 @@ std::string RPCHelpMan::ToString() const
ret += m_name;
bool was_optional{false};
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();
ret += " ";
if (optional) {
Expand All @@ -526,7 +526,7 @@ std::string RPCHelpMan::ToString() const
Sections sections;
for (size_t i{0}; i < m_args.size(); ++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";

Expand Down

0 comments on commit fa459bd

Please sign in to comment.