mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-02 12:44:26 +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:
@@ -24,7 +24,6 @@ DEVTOOLS_COMMON_OBJS := \
|
||||
common/bolt11.o \
|
||||
common/blockheight_states.o \
|
||||
common/channel_id.o \
|
||||
common/configdir.o \
|
||||
common/decode_array.o \
|
||||
common/features.o \
|
||||
common/fee_states.o \
|
||||
@@ -87,7 +86,7 @@ devtools/mkgossip: $(DEVTOOLS_COMMON_OBJS) $(BITCOIN_OBJS) wire/fromwire.o wire/
|
||||
|
||||
devtools/mkencoded: $(DEVTOOLS_COMMON_OBJS) $(BITCOIN_OBJS) wire/fromwire.o wire/towire.o devtools/mkencoded.o
|
||||
|
||||
devtools/checkchannels: $(DEVTOOLS_COMMON_OBJS) $(BITCOIN_OBJS) common/configdir.o wire/fromwire.o wire/towire.o devtools/checkchannels.o
|
||||
devtools/checkchannels: $(DEVTOOLS_COMMON_OBJS) $(BITCOIN_OBJS) wire/fromwire.o wire/towire.o devtools/checkchannels.o common/configdir.o common/configvar.o
|
||||
|
||||
devtools/mkquery: $(DEVTOOLS_COMMON_OBJS) $(BITCOIN_OBJS) wire/fromwire.o wire/towire.o devtools/mkquery.o
|
||||
|
||||
|
||||
@@ -414,6 +414,8 @@ static bool print_extra_fields(const struct tlv_field *fields)
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool deprecated_apis = true;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
const tal_t *ctx = tal(NULL, char);
|
||||
@@ -424,7 +426,6 @@ int main(int argc, char *argv[])
|
||||
bool to_hex = false;
|
||||
|
||||
common_setup(argv[0]);
|
||||
deprecated_apis = true;
|
||||
|
||||
opt_set_alloc(opt_allocfn, tal_reallocfn, tal_freefn);
|
||||
opt_register_noarg("--help|-h", opt_usage_and_exit,
|
||||
|
||||
@@ -109,7 +109,7 @@ static void copy_column(void *dst, size_t size,
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
char *config_dir, *net_dir, *config_filename, *rpc_filename, *hsmfile, *dbfile;
|
||||
char *net_dir, *rpc_filename, *hsmfile, *dbfile;
|
||||
sqlite3 *sql;
|
||||
sqlite3_stmt *stmt;
|
||||
int flags = SQLITE_OPEN_READONLY, dberr;
|
||||
@@ -124,14 +124,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
setup_option_allocators();
|
||||
|
||||
initial_config_opts(top_ctx, argc, argv,
|
||||
&config_filename, &config_dir, &net_dir,
|
||||
&rpc_filename);
|
||||
minimal_config_opts(top_ctx, argc, argv, &net_dir, &rpc_filename);
|
||||
|
||||
opt_register_noarg("-v|--verbose", opt_set_bool, &verbose,
|
||||
"Print everything");
|
||||
|
||||
opt_parse(&argc, argv, opt_log_stderr_exit);
|
||||
|
||||
if (argc != 1)
|
||||
errx(1, "no arguments accepted");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user