lightning-cli: fix error code on invalid options, document them.

The top of the file indicates the following errors:

    #define NO_ERROR 0
    #define ERROR_FROM_LIGHTNINGD 1
    #define ERROR_TALKING_TO_LIGHTNINGD 2
    #define ERROR_USAGE 3

But we didn't use the right one for opt_parse failure, and didn't use the
correct constants everywhere.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-01-03 14:53:15 +10:30
parent a1e894a445
commit 435f8d84dc
3 changed files with 58 additions and 4 deletions

View File

@@ -130,6 +130,15 @@ BUGS
This manpage documents how it should work, not how it does work. The
pretty printing of results isn't pretty.
EXIT STATUS
-----------
If the command succeeds, the exit status is 0. Otherwise:
* `1`: lightningd(7) returned an error reply (which is printed).
* `2`: we could not talk to lightningd.
* `3`: usage error, such as bad arguments or malformed JSON in the parameters.
AUTHOR
------