mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
rpc: Named argument support for bitcoin-cli
Usage e.g.:
$ src/bitcoin-cli -testnet -named echo arg0="dfdf"
[
"dfdf"
]
Argument conversion also works, for arguments thus flagged in the table in
`src/rpc/client.cpp`.
$ src/bitcoin-cli -testnet -named echojson arg0="[1,2,3]"
[
[
1,
2,
3
]
]
Unknown parameter (detected server-side):
$ src/bitcoin-cli -testnet -named getinfo arg0="dfdf"
error code: -8
error message:
Unknown named parameter arg0
This commit is contained in:
@@ -8,7 +8,12 @@
|
||||
|
||||
#include <univalue.h>
|
||||
|
||||
/** Convert positional arguments to command-specific RPC representation */
|
||||
UniValue RPCConvertValues(const std::string& strMethod, const std::vector<std::string>& strParams);
|
||||
|
||||
/** Convert named arguments to command-specific RPC representation */
|
||||
UniValue RPCConvertNamedValues(const std::string& strMethod, const std::vector<std::string>& strParams);
|
||||
|
||||
/** Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, false, null)
|
||||
* as well as objects and arrays.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user