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:
Rusty Russell
2023-06-02 12:05:51 +09:30
parent f54e4f3084
commit edbaa944da
20 changed files with 312 additions and 320 deletions

View File

@@ -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");