mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-09 16:14:19 +01:00
lightningd: switch parsing to common/configvar
Now we wire in the code which gathers configvars and parses from there; lightningd keeps the array of configuration variables for future use. Note that lightning-cli also needs to read the config, but it has its own options (including short ones!) and doesn't want to use this configvar mechanism, so we have a different API for that now. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -650,7 +650,7 @@ int main(int argc, char *argv[])
|
||||
jsmntok_t *toks;
|
||||
const jsmntok_t *result, *error, *id;
|
||||
const tal_t *ctx = tal(NULL, char);
|
||||
char *config_filename, *lightning_dir, *net_dir, *rpc_filename;
|
||||
char *net_dir, *rpc_filename;
|
||||
jsmn_parser parser;
|
||||
int parserr;
|
||||
enum format format = DEFAULT_FORMAT;
|
||||
@@ -667,9 +667,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
setup_option_allocators();
|
||||
|
||||
initial_config_opts(ctx, argc, argv,
|
||||
&config_filename, &lightning_dir, &net_dir,
|
||||
&rpc_filename);
|
||||
opt_exitcode = ERROR_USAGE;
|
||||
minimal_config_opts(ctx, argc, argv, &net_dir, &rpc_filename);
|
||||
|
||||
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");
|
||||
@@ -695,8 +694,6 @@ int main(int argc, char *argv[])
|
||||
NULL, &commando,
|
||||
"Send this as a commando command to nodeid:rune");
|
||||
|
||||
opt_register_version();
|
||||
|
||||
opt_early_parse(argc, argv, opt_log_stderr_exit_usage);
|
||||
opt_parse(&argc, argv, opt_log_stderr_exit_usage);
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ ALL_TEST_PROGRAMS += $(CLI_TEST_PROGRAMS)
|
||||
CLI_TEST_COMMON_OBJS := \
|
||||
common/autodata.o \
|
||||
common/configdir.o \
|
||||
common/configvar.o \
|
||||
common/daemon_conn.o \
|
||||
common/htlc_state.o \
|
||||
common/json_parse_simple.o \
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <common/amount.h>
|
||||
#include <common/bigsize.h>
|
||||
#include <common/channel_id.h>
|
||||
#include <common/configvar.h>
|
||||
#include <common/json_stream.h>
|
||||
#include <common/node_id.h>
|
||||
#include <common/setup.h>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <common/amount.h>
|
||||
#include <common/bigsize.h>
|
||||
#include <common/channel_id.h>
|
||||
#include <common/configvar.h>
|
||||
#include <common/json_stream.h>
|
||||
#include <common/node_id.h>
|
||||
#include <common/setup.h>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <common/amount.h>
|
||||
#include <common/bigsize.h>
|
||||
#include <common/channel_id.h>
|
||||
#include <common/configvar.h>
|
||||
#include <common/json_stream.h>
|
||||
#include <common/node_id.h>
|
||||
#include <common/setup.h>
|
||||
|
||||
Reference in New Issue
Block a user