Skip to content

Commit fa459bd

Browse files
author
MarcoFalke
committed
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
1 parent a787428 commit fa459bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rpc/util.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ std::string RPCHelpMan::ToString() const
504504
ret += m_name;
505505
bool was_optional{false};
506506
for (const auto& arg : m_args) {
507-
if (arg.m_hidden) continue;
507+
if (arg.m_hidden) break; // Any arg that follows is also hidden
508508
const bool optional = arg.IsOptional();
509509
ret += " ";
510510
if (optional) {
@@ -526,7 +526,7 @@ std::string RPCHelpMan::ToString() const
526526
Sections sections;
527527
for (size_t i{0}; i < m_args.size(); ++i) {
528528
const auto& arg = m_args.at(i);
529-
if (arg.m_hidden) continue;
529+
if (arg.m_hidden) break; // Any arg that follows is also hidden
530530

531531
if (i == 0) ret += "\nArguments:\n";
532532

0 commit comments

Comments
 (0)