Support ranges arguments in RPC help
This commit is contained in:
parent
7aa6a8aefb
commit
6b9f45e81b
2 changed files with 9 additions and 0 deletions
|
@ -200,6 +200,7 @@ struct Sections {
|
||||||
case RPCArg::Type::STR:
|
case RPCArg::Type::STR:
|
||||||
case RPCArg::Type::NUM:
|
case RPCArg::Type::NUM:
|
||||||
case RPCArg::Type::AMOUNT:
|
case RPCArg::Type::AMOUNT:
|
||||||
|
case RPCArg::Type::RANGE:
|
||||||
case RPCArg::Type::BOOL: {
|
case RPCArg::Type::BOOL: {
|
||||||
if (outer_type == OuterType::NAMED_ARG) return; // Nothing more to do for non-recursive types on first recursion
|
if (outer_type == OuterType::NAMED_ARG) return; // Nothing more to do for non-recursive types on first recursion
|
||||||
auto left = indent;
|
auto left = indent;
|
||||||
|
@ -405,6 +406,10 @@ std::string RPCArg::ToDescriptionString() const
|
||||||
ret += "numeric or string";
|
ret += "numeric or string";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case Type::RANGE: {
|
||||||
|
ret += "numeric or array";
|
||||||
|
break;
|
||||||
|
}
|
||||||
case Type::BOOL: {
|
case Type::BOOL: {
|
||||||
ret += "boolean";
|
ret += "boolean";
|
||||||
break;
|
break;
|
||||||
|
@ -464,6 +469,8 @@ std::string RPCArg::ToStringObj(const bool oneline) const
|
||||||
return res + "\"hex\"";
|
return res + "\"hex\"";
|
||||||
case Type::NUM:
|
case Type::NUM:
|
||||||
return res + "n";
|
return res + "n";
|
||||||
|
case Type::RANGE:
|
||||||
|
return res + "n or [n,n]";
|
||||||
case Type::AMOUNT:
|
case Type::AMOUNT:
|
||||||
return res + "amount";
|
return res + "amount";
|
||||||
case Type::BOOL:
|
case Type::BOOL:
|
||||||
|
@ -494,6 +501,7 @@ std::string RPCArg::ToString(const bool oneline) const
|
||||||
return "\"" + m_name + "\"";
|
return "\"" + m_name + "\"";
|
||||||
}
|
}
|
||||||
case Type::NUM:
|
case Type::NUM:
|
||||||
|
case Type::RANGE:
|
||||||
case Type::AMOUNT:
|
case Type::AMOUNT:
|
||||||
case Type::BOOL: {
|
case Type::BOOL: {
|
||||||
return m_name;
|
return m_name;
|
||||||
|
|
|
@ -51,6 +51,7 @@ struct RPCArg {
|
||||||
OBJ_USER_KEYS, //!< Special type where the user must set the keys e.g. to define multiple addresses; as opposed to e.g. an options object where the keys are predefined
|
OBJ_USER_KEYS, //!< Special type where the user must set the keys e.g. to define multiple addresses; as opposed to e.g. an options object where the keys are predefined
|
||||||
AMOUNT, //!< Special type representing a floating point amount (can be either NUM or STR)
|
AMOUNT, //!< Special type representing a floating point amount (can be either NUM or STR)
|
||||||
STR_HEX, //!< Special type that is a STR with only hex chars
|
STR_HEX, //!< Special type that is a STR with only hex chars
|
||||||
|
RANGE, //!< Special type that is a NUM or [NUM,NUM]
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class Optional {
|
enum class Optional {
|
||||||
|
|
Loading…
Add table
Reference in a new issue