commit 4f5d44b93f70e0c6c457c6277d77c56d3834107d
parent eda1c8435fd6fbb878ec67a40d14c5a018938f76
Author: William Casarin <jb55@jb55.com>
Date: Sat, 22 Jan 2022 13:10:07 -0800
rpc arg, docs
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/rpc.c b/rpc.c
@@ -11,7 +11,7 @@
int usage()
{
- printf("lnrpc <nodeid> <ip/hostname> <method> <params> <rune>\n\n");
+ printf("lnrpc <nodeid> <ip/hostname> <method> <rune> [params (json string)]\n\n");
printf("currently supports commando for clightning, but potentially more rpc types in the future!\n");
return 0;
}
@@ -26,7 +26,7 @@ int main(int argc, const char *argv[])
int verbose = getenv("VERBOSE") != 0;
//int verbose = 1;
- if (argc < 6)
+ if (argc < 5)
return usage();
ln = lnsocket_create();
@@ -37,8 +37,8 @@ int main(int argc, const char *argv[])
const char *nodeid = argv[1];
const char *host = argv[2];
const char *method = argv[3];
- const char *params = argv[4];
- const char *rune = argv[5];
+ const char *rune = argv[4];
+ const char *params = argc < 6 ? argv[5] : NULL;
if (!(ok = lnsocket_connect(ln, nodeid, host)))
goto done;