Skip to content

Commit

Permalink
lightningd: handle --version before trying to move to lightning-dir.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rustyrussell committed Aug 3, 2019
1 parent b460590 commit 4c9bfa3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lightningd/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 4c9bfa3

Please sign in to comment.