libplugin.c: Handle command categories then set them in pay and autoclean
This commit is contained in:
parent
5b0bf0ba1f
commit
9d34121ec5
|
@ -71,6 +71,7 @@ static void init(struct plugin_conn *prpc)
|
|||
|
||||
static const struct plugin_command commands[] = { {
|
||||
"autocleaninvoice",
|
||||
"payment",
|
||||
"Set up autoclean of expired invoices. ",
|
||||
"Perform cleanup every {cycle_seconds} (default 3600), or disable autoclean if 0. "
|
||||
"Clean up expired invoices that have expired for {expired_by} seconds (default 86400). ",
|
||||
|
|
|
@ -452,9 +452,11 @@ handle_getmanifest(struct command *getmanifest_cmd,
|
|||
|
||||
for (size_t i = 0; i < num_commands; i++) {
|
||||
tal_append_fmt(¶ms, "{ 'name': '%s',"
|
||||
" 'category': '%s',"
|
||||
" 'usage': '%s',"
|
||||
" 'description': '%s'",
|
||||
commands[i].name,
|
||||
commands[i].category,
|
||||
strmap_get(&usagemap, commands[i].name),
|
||||
commands[i].description);
|
||||
if (commands[i].long_description)
|
||||
|
|
|
@ -18,6 +18,7 @@ extern bool deprecated_apis;
|
|||
/* Create an array of these, one for each command you support. */
|
||||
struct plugin_command {
|
||||
const char *name;
|
||||
const char *category;
|
||||
const char *description;
|
||||
const char *long_description;
|
||||
struct command_result *(*handle)(struct command *cmd,
|
||||
|
|
|
@ -1225,16 +1225,19 @@ static void init(struct plugin_conn *rpc)
|
|||
|
||||
static const struct plugin_command commands[] = { {
|
||||
"pay",
|
||||
"payment",
|
||||
"Send payment specified by {bolt11} with {amount}",
|
||||
"Try to send a payment, retrying {retry_for} seconds before giving up",
|
||||
json_pay
|
||||
}, {
|
||||
"paystatus",
|
||||
"payment",
|
||||
"Detail status of attempts to pay {bolt11}, or all",
|
||||
"Covers both old payments and current ones.",
|
||||
json_paystatus
|
||||
}, {
|
||||
"listpays",
|
||||
"payment",
|
||||
"List result of payment {bolt11}, or all",
|
||||
"Covers old payments (failed and succeeded) and current ones.",
|
||||
json_listpays
|
||||
|
|
Loading…
Reference in New Issue