lightning-cli: document the real argument handling (for special effects).

And fix it to pass through decimals like the man page promises!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2022-04-06 11:24:09 +09:30
parent 356514c753
commit d95ea51a73
2 changed files with 3 additions and 2 deletions

View File

@ -276,7 +276,7 @@ static bool is_literal(const char *arg)
if (arglen == 0) { if (arglen == 0) {
return false; return false;
} }
return strspn(arg, "0123456789") == arglen return strspn(arg, "0123456789.") == arglen
|| streq(arg, "true") || streq(arg, "true")
|| streq(arg, "false") || streq(arg, "false")
|| streq(arg, "null") || streq(arg, "null")

View File

@ -89,7 +89,8 @@ this is to avoid having lightningd intrepret the position of an arguement.
Arguments may be integer numbers (composed entirely of digits), floating-point Arguments may be integer numbers (composed entirely of digits), floating-point
numbers (has a radix point but otherwise composed of digits), *true*, *false*, numbers (has a radix point but otherwise composed of digits), *true*, *false*,
or *null*. Other arguments are treated as strings. or *null*. Arguments which begin with *{*, *[* or *"* are also considered
raw JSON and are passed through. Other arguments are treated as strings.
Some commands have optional arguments. You may use *null* to skip Some commands have optional arguments. You may use *null* to skip
optional arguments to provide later arguments, although this is not encouraged. optional arguments to provide later arguments, although this is not encouraged.