Skip to content

Commit

Permalink
doc: update cli documentation.
Browse files Browse the repository at this point in the history
1. help now uses a boutique format, not -H.
2. document the -F option.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed May 15, 2020
1 parent abb16b4 commit 3c625b3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cli/lightning-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ int main(int argc, char *argv[])
opt_register_noarg("--help|-h", opt_usage_and_exit,
"<command> [<params>...]", "Show this message. Use the command help (without hyphens -- \"lightning-cli help\") to get a list of all RPC commands");
opt_register_noarg("-H|--human-readable", opt_set_human, &format,
"Human-readable output (default for 'help')");
"Human-readable output");
opt_register_noarg("-F|--flat", opt_set_flat, &format,
"Flatten output ('x.y.x=' format)");
opt_register_noarg("-J|--json", opt_set_json, &format,
Expand Down
24 changes: 20 additions & 4 deletions doc/lightning-cli.1
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,40 @@ Follow strictly the order of parameters for the command


\fB--json\fR/\fB-J\fR
Return result in JSON format (default unless \fIhelp\fR command)
Return result in JSON format (default unless \fIhelp\fR command,
or result contains a \fBformat-hint\fR field)\.


\fB--raw\fR/\fB-R\fR
Return raw JSON directly as lightningd replies
Return raw JSON directly as lightningd replies; this can be faster for
large requests\.


\fB--human-readable\fR/\fB-H\fR
Return result in human-readable output (default for \fIhelp\fR command)
Return result in human-readable output\.


\fB--flat\fR/\fB-F\fR
Return JSON result in flattened one-per-line output, e\.g\. \fB{ "help":
[ { "command": "check" } ] }\fR would become \fBhelp[0].command=check\fR\.
This is useful for simple scripts which want to find a specific output
field without parsing JSON\.


\fB--help\fR/\fB-h\fR
Print summary of options to standard output and exit\.
Pretty-print summary of options to standard output and exit\. The format can
be changed using -F, -R, -J, -H etc\.


\fB--version\fR/\fB-V\fR
Print version number to standard output and exit\.


\fBallow-deprecated-apis\fR=\fIBOOL\fR
Enable deprecated options\. It defaults to \fItrue\fR, but you should set
it to \fIfalse\fR when testing to ensure that an upgrade won’t break your
configuration\.

.SH COMMANDS

\fIlightning-cli\fR simply uses the JSON RPC interface to talk to
Expand Down
17 changes: 13 additions & 4 deletions doc/lightning-cli.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,25 @@ Use format *key*=*value* for parameters in any order
Follow strictly the order of parameters for the command

**--json**/**-J**
Return result in JSON format (default unless *help* command)
Return result in JSON format (default unless *help* command,
or result contains a `format-hint` field).

**--raw**/**-R**
Return raw JSON directly as lightningd replies
Return raw JSON directly as lightningd replies; this can be faster for
large requests.

**--human-readable**/**-H**
Return result in human-readable output (default for *help* command)
Return result in human-readable output.

**--flat**/**-F**
Return JSON result in flattened one-per-line output, e.g. `{ "help":
[ { "command": "check" } ] }` would become `help[0].command=check`.
This is useful for simple scripts which want to find a specific output
field without parsing JSON.

**--help**/**-h**
Print summary of options to standard output and exit.
Pretty-print summary of options to standard output and exit. The format can
be changed using -F, -R, -J, -H etc.

**--version**/**-V**
Print version number to standard output and exit.
Expand Down

0 comments on commit 3c625b3

Please sign in to comment.