mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
JSONRPC: help returns an object.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -53,7 +53,7 @@ static const struct json_command help_command = {
|
|||||||
"help",
|
"help",
|
||||||
json_help,
|
json_help,
|
||||||
"List available commands",
|
"List available commands",
|
||||||
"Returns an array of available commands",
|
"Returns an array {help} of available commands",
|
||||||
};
|
};
|
||||||
AUTODATA(json_command, &help_command);
|
AUTODATA(json_command, &help_command);
|
||||||
|
|
||||||
@@ -295,7 +295,8 @@ static void json_help(struct command *cmd,
|
|||||||
struct json_result *response = new_json_result(cmd);
|
struct json_result *response = new_json_result(cmd);
|
||||||
struct json_command **cmdlist = get_cmdlist();
|
struct json_command **cmdlist = get_cmdlist();
|
||||||
|
|
||||||
json_array_start(response, NULL);
|
json_object_start(response, NULL);
|
||||||
|
json_array_start(response, "help");
|
||||||
for (i = 0; i < num_cmdlist; i++) {
|
for (i = 0; i < num_cmdlist; i++) {
|
||||||
json_add_object(response,
|
json_add_object(response,
|
||||||
"command", JSMN_STRING,
|
"command", JSMN_STRING,
|
||||||
@@ -305,6 +306,7 @@ static void json_help(struct command *cmd,
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
json_array_end(response);
|
json_array_end(response);
|
||||||
|
json_object_end(response);
|
||||||
command_success(cmd, response);
|
command_success(cmd, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user