diff --git a/doc/Makefile b/doc/Makefile index fe57a92a9..10e78060b 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -9,7 +9,7 @@ MANPAGES := doc/lightning-cli.1 \ doc/lightning-delinvoice.7 \ doc/lightning-getroute.7 \ doc/lightning-invoice.7 \ - doc/lightning-listinvoice.7 \ + doc/lightning-listinvoices.7 \ doc/lightning-listpayments.7 \ doc/lightning-pay.7 \ doc/lightning-sendpay.7 \ diff --git a/doc/lightning-listinvoice.7 b/doc/lightning-listinvoices.7 similarity index 84% rename from doc/lightning-listinvoice.7 rename to doc/lightning-listinvoices.7 index 135849752..93ad4f9cd 100644 --- a/doc/lightning-listinvoice.7 +++ b/doc/lightning-listinvoices.7 @@ -1,13 +1,13 @@ '\" t -.\" Title: lightning-listinvoice +.\" Title: lightning-listinvoices .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 01/13/2018 +.\" Date: 01/16/2018 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "LIGHTNING\-LISTINVOI" "7" "01/13/2018" "\ \&" "\ \&" +.TH "LIGHTNING\-LISTINVOI" "7" "01/16/2018" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,13 +28,13 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -lightning-listinvoice \- Protocol for querying invoice status +lightning-listinvoices \- Protocol for querying invoice status .SH "SYNOPSIS" .sp -\fBlistinvoice\fR [\fIlabel\fR] +\fBlistinvoices\fR [\fIlabel\fR] .SH "DESCRIPTION" .sp -The \fBlistinvoice\fR RPC command gets the status of a specific invoice, if it exists, or the status of all invoices if given no argument\&. +The \fBlistinvoices\fR RPC command gets the status of a specific invoice, if it exists, or the status of all invoices if given no argument\&. .SH "RETURN VALUE" .sp On success, an array \fIinvoices\fR of objects is returned\&. Each object contains \fIlabel\fR, \fIpayment_hash, \*(Aqcomplete\fR (a boolean), and \fIexpiry_time\fR (a UNIX timestamp)\&. If the \fImsatoshi\fR argument to lightning\-invoice(7) was not "any", there will be an \fImsatoshi\fR field\&. If the invoice has been paid, there will be a \fIpay_index\fR field and an \fImsatoshi_received\fR field (which may be slightly greater than \fImsatoshi\fR as some overpaying is permitted to allow clients to obscure payment paths)\&. diff --git a/doc/lightning-listinvoice.7.txt b/doc/lightning-listinvoices.7.txt similarity index 81% rename from doc/lightning-listinvoice.7.txt rename to doc/lightning-listinvoices.7.txt index 9f5c766e3..2ec20961c 100644 --- a/doc/lightning-listinvoice.7.txt +++ b/doc/lightning-listinvoices.7.txt @@ -1,18 +1,18 @@ -LIGHTNING-LISTINVOICE(7) -======================== +LIGHTNING-LISTINVOICES(7) +========================= :doctype: manpage NAME ---- -lightning-listinvoice - Protocol for querying invoice status +lightning-listinvoices - Protocol for querying invoice status SYNOPSIS -------- -*listinvoice* ['label'] +*listinvoices* ['label'] DESCRIPTION ----------- -The *listinvoice* RPC command gets the status of a specific invoice, if +The *listinvoices* RPC command gets the status of a specific invoice, if it exists, or the status of all invoices if given no argument. RETURN VALUE diff --git a/lightningd/invoice.c b/lightningd/invoice.c index 67222eb75..bb65fb3e5 100644 --- a/lightningd/invoice.c +++ b/lightningd/invoice.c @@ -222,11 +222,20 @@ static void json_listinvoice(struct command *cmd, static const struct json_command listinvoice_command = { "listinvoice", json_listinvoice, - "Show invoice {label} (or all, if no {label}))", - "Returns an array of {label}, {payment_hash}, {msatoshi} (if set), {complete}, {pay_index} (if paid) and {expiry_time} on success. " + "(DEPRECATED) Show invoice {label} (or all, if no {label}))", + "Returns an array of {label}, {payment_hash}, {msatoshi} (if set), {complete}, {pay_index} (if paid) and {expiry_time} on success. ", + .deprecated = true }; AUTODATA(json_command, &listinvoice_command); +static const struct json_command listinvoice_command = { + "listinvoices", + json_listinvoices, + "Show invoice {label} (or all, if no {label}))", + "Returns an array of {label}, {payment_hash}, {msatoshi} (if set), {complete}, {pay_index} (if paid) and {expiry_time} on success. ", +}; +AUTODATA(json_command, &listinvoices_command); + static void json_delinvoice(struct command *cmd, const char *buffer, const jsmntok_t *params) {