From fa91e8eda541acdb78ca481b74605639f319c108 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sat, 20 Oct 2018 08:19:44 -0400 Subject: Use RPCHelpMan for all RPCs --- src/rpc/util.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/rpc/util.h') 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 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& 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& 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& args) - : m_name{name}, m_args{args} + RPCHelpMan(const std::string& name, const std::string& description, const std::vector& 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 m_args; }; -- cgit v1.2.3