Browse Source

lightningd: handle --version before trying to move to lightning-dir.

Otherwise it creates the lightning-dir.  This can't be helped for --help
(at least, if plugins are present), but --version simply prints and exits.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
pull/2938/head
Rusty Russell 5 years ago
parent
commit
4c9bfa351a
  1. 3
      lightningd/options.c

3
lightningd/options.c

@ -747,6 +747,9 @@ static void handle_minimal_config_opts(struct lightningd *ld,
&ld->config_dir,
"Set working directory. All other files are relative to this");
/* Handle --version (and exit) here too: don't create lightning-dir for this */
opt_register_version();
opt_early_parse_incomplete(argc, argv, opt_log_stderr_exit);
/* Now, reset and ignore those options from now on. */

Loading…
Cancel
Save