|
|
@ -4,6 +4,13 @@ |
|
|
|
#include <ccan/tal/str/str.h> |
|
|
|
#include <errno.h> |
|
|
|
|
|
|
|
/* Override a tal string; frees the old one. */ |
|
|
|
char *opt_set_talstr(const char *arg, char **p) |
|
|
|
{ |
|
|
|
tal_free(*p); |
|
|
|
return opt_set_charp(arg, p); |
|
|
|
} |
|
|
|
|
|
|
|
static char *default_configdir(const tal_t *ctx) |
|
|
|
{ |
|
|
|
char *path; |
|
|
@ -21,11 +28,11 @@ void configdir_register_opts(const tal_t *ctx, |
|
|
|
*configdir = default_configdir(ctx); |
|
|
|
*rpc_filename = "lightning-rpc"; |
|
|
|
|
|
|
|
opt_register_early_arg("--lightning-dir", opt_set_charp, opt_show_charp, |
|
|
|
opt_register_early_arg("--lightning-dir", opt_set_talstr, opt_show_charp, |
|
|
|
configdir, |
|
|
|
"working directory: all other files are relative to this"); |
|
|
|
|
|
|
|
opt_register_arg("--rpc-file", opt_set_charp, opt_show_charp, |
|
|
|
opt_register_arg("--rpc-file", opt_set_talstr, opt_show_charp, |
|
|
|
rpc_filename, |
|
|
|
"Set JSON-RPC socket (or /dev/tty)"); |
|
|
|
} |
|
|
|