aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/util.h
diff options
context:
space:
mode:
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;
};