diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-11-23 08:35:36 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-11-23 09:42:33 +0100 |
commit | a0d86815cda982d06db333fd9290aa82660807cb (patch) | |
tree | 1046bf15a8216e3ab0ceb3288933976740319e85 /src/rpc/util.h | |
parent | d7fbe7d927eae37056a751af681507c06c774f2f (diff) | |
parent | fa5e0452e875a7ca6bf6fe61fdd652d341eece40 (diff) |
Merge #14726: Use RPCHelpMan for all RPCs
fa5e0452e875a7ca6bf6fe61fdd652d341eece40 rpc: Documentation fixups (MarcoFalke)
fa91e8eda541acdb78ca481b74605639f319c108 Use RPCHelpMan for all RPCs (MarcoFalke)
fa520e72f7b5964cea1ade666e71212914556cf3 lint: Must use RPCHelpMan to generate the RPC docs (MarcoFalke)
Pull request description:
The resulting documentation should not change unless the type in the oneline-summary was previously incorrect. (E.g. string vs bool)
Tree-SHA512: 4ff355b6a53178f02781e97a7aca7ee1d0d97ff348b6bf5a01caa1c96904ee33c704465fae54c2cd7445097427fd04c71ad3779bb7a7ed886055ef36c1b5a1d0
Diffstat (limited to 'src/rpc/util.h')
-rw-r--r-- | src/rpc/util.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/rpc/util.h b/src/rpc/util.h index 6d1e591f12..b1ab64247c 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -43,15 +43,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); } @@ -65,8 +66,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} { } @@ -74,6 +75,7 @@ public: private: const std::string m_name; + const std::string m_description; const std::vector<RPCArg> m_args; }; |