diff --git a/src/rpc/node.cpp b/src/rpc/node.cpp index 3610d87fdf4..232a1d16f4e 100644 --- a/src/rpc/node.cpp +++ b/src/rpc/node.cpp @@ -273,8 +273,9 @@ static RPCHelpMan logging() static RPCHelpMan echo(const std::string& name) { - return RPCHelpMan{name, - "\nSimply echo back the input arguments. This command is for testing.\n" + return RPCHelpMan{ + name, + "Simply echo back the input arguments. This command is for testing.\n" "\nIt will return an internal bug report when arg9='trigger_internal_bug' is passed.\n" "\nThe difference between echo and echojson is that echojson has argument conversion enabled in the client-side table in " "bitcoin-cli and the GUI. There is no server-side difference.", diff --git a/src/rpc/output_script.cpp b/src/rpc/output_script.cpp index e5458278122..398154901c8 100644 --- a/src/rpc/output_script.cpp +++ b/src/rpc/output_script.cpp @@ -169,8 +169,9 @@ static RPCHelpMan getdescriptorinfo() { const std::string EXAMPLE_DESCRIPTOR = "wpkh([d34db33f/84h/0h/0h]0279be667ef9dcbbac55a06295Ce870b07029Bfcdb2dce28d959f2815b16f81798)"; - return RPCHelpMan{"getdescriptorinfo", - {"\nAnalyses a descriptor.\n"}, + return RPCHelpMan{ + "getdescriptorinfo", + "Analyses a descriptor.\n", { {"descriptor", RPCArg::Type::STR, RPCArg::Optional::NO, "The descriptor."}, }, @@ -260,8 +261,9 @@ static RPCHelpMan deriveaddresses() { const std::string EXAMPLE_DESCRIPTOR = "wpkh([d34db33f/84h/0h/0h]xpub6DJ2dNUysrn5Vt36jH2KLBT2i1auw1tTSSomg8PhqNiUtx8QX2SvC9nrHu81fT41fvDUnhMjEzQgXnQjKEu3oaqMSzhSrHMxyyoEAmUHQbY/0/*)#cjjspncu"; - return RPCHelpMan{"deriveaddresses", - {"\nDerives one or more addresses corresponding to an output descriptor.\n" + return RPCHelpMan{ + "deriveaddresses", + "Derives one or more addresses corresponding to an output descriptor.\n" "Examples of output descriptors are:\n" " pkh() P2PKH outputs for the given pubkey\n" " wpkh() Native segwit P2PKH outputs for the given pubkey\n" @@ -270,7 +272,7 @@ static RPCHelpMan deriveaddresses() " tr(,multi_a(,,,...)) P2TR-multisig outputs for the given threshold and pubkeys\n" "\nIn the above, either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one\n" "or more path elements separated by \"/\", where \"h\" represents a hardened child key.\n" - "For more information on output descriptors, see the documentation in the doc/descriptors.md file.\n"}, + "For more information on output descriptors, see the documentation in the doc/descriptors.md file.\n", { {"descriptor", RPCArg::Type::STR, RPCArg::Optional::NO, "The descriptor."}, {"range", RPCArg::Type::RANGE, RPCArg::Optional::OMITTED, "If a ranged descriptor is used, this specifies the end or the range (in [begin,end] notation) to derive."}, diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 55d828d6fe2..8631ae0adfe 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -156,11 +156,12 @@ static RPCHelpMan help() static RPCHelpMan stop() { static const std::string RESULT{CLIENT_NAME " stopping"}; - return RPCHelpMan{"stop", + return RPCHelpMan{ + "stop", // Also accept the hidden 'wait' integer argument (milliseconds) // For instance, 'stop 1000' makes the call wait 1 second before returning // to the client (intended for testing) - "\nRequest a graceful shutdown of " CLIENT_NAME ".", + "Request a graceful shutdown of " CLIENT_NAME ".", { {"wait", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "how long to wait in ms", RPCArgOptions{.hidden=true}}, }, diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp index 4c83517c8da..f66c1eb6c10 100644 --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2022 The Bitcoin Core developers +// Copyright (c) 2017-present The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -814,6 +814,7 @@ std::string RPCHelpMan::ToString() const if (was_optional) ret += " )"; // Description + CHECK_NONFATAL(!m_description.starts_with('\n')); // Historically \n was required, but reject it for new code. ret += "\n\n" + TrimString(m_description) + "\n"; // Arguments