aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/util.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-10-20 08:19:44 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-11-14 15:33:15 -0500
commitfa91e8eda541acdb78ca481b74605639f319c108 (patch)
treec6f299e2daa4c2428ca2039a538b4686a1c1d5f6 /src/rpc/util.h
parentfa520e72f7b5964cea1ade666e71212914556cf3 (diff)
downloadbitcoin-fa91e8eda541acdb78ca481b74605639f319c108.tar.xz
Use RPCHelpMan for all RPCs
Diffstat (limited to 'src/rpc/util.h')
-rw-r--r--src/rpc/util.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/rpc/util.h b/src/rpc/util.h
index 55ae2fa363..b07922c05a 100644
--- a/src/rpc/util.h
+++ b/src/rpc/util.h
@@ -45,15 +45,16 @@ struct RPCArg {
const Type m_type;
const std::vector<RPCArg> m_inner; //!< Only used for arrays or dicts
const bool m_optional;
+ const std::string m_oneline_description; //!< Should be empty unless it is supposed to override the auto-generated summary line
- RPCArg(const std::string& name, const Type& type, const bool optional)
- : m_name{name}, m_type{type}, m_optional{optional}
+ RPCArg(const std::string& name, const Type& type, const bool optional, const std::string& oneline_description = "")
+ : m_name{name}, m_type{type}, m_optional{optional}, m_oneline_description{oneline_description}
{
assert(type != Type::ARR && type != Type::OBJ);
}
- RPCArg(const std::string& name, const Type& type, const std::vector<RPCArg>& inner, const bool optional)
- : m_name{name}, m_type{type}, m_inner{inner}, m_optional{optional}
+ RPCArg(const std::string& name, const Type& type, const std::vector<RPCArg>& inner, const bool optional, const std::string& oneline_description = "")
+ : m_name{name}, m_type{type}, m_inner{inner}, m_optional{optional}, m_oneline_description{oneline_description}
{
assert(type == Type::ARR || type == Type::OBJ);
}
@@ -67,8 +68,8 @@ private:
class RPCHelpMan
{
public:
- RPCHelpMan(const std::string& name, const std::vector<RPCArg>& args)
- : m_name{name}, m_args{args}
+ RPCHelpMan(const std::string& name, const std::string& description, const std::vector<RPCArg>& args)
+ : m_name{name}, m_description{description}, m_args{args}
{
}
@@ -76,6 +77,7 @@ public:
private:
const std::string m_name;
+ const std::string m_description;
const std::vector<RPCArg> m_args;
};