node: Fix log output in `--help`

The logs were being output in the help text.
This commit is contained in:
Alexis Sellier 2023-04-19 17:37:24 +02:00
parent 26ee6d26dc
commit a16be24517
No known key found for this signature in database
1 changed files with 3 additions and 5 deletions

View File

@ -29,7 +29,6 @@ Options
--force Force start even if an existing control socket is found --force Force start even if an existing control socket is found
--help Print help --help Print help
--listen <address> Address to listen on --listen <address> Address to listen on
"#; "#;
#[derive(Debug)] #[derive(Debug)]
@ -134,14 +133,13 @@ impl Options {
fn execute() -> anyhow::Result<()> { fn execute() -> anyhow::Result<()> {
logger::init(log::Level::Debug)?; logger::init(log::Level::Debug)?;
let options = Options::from_env()?;
log::info!(target: "node", "Starting node.."); log::info!(target: "node", "Starting node..");
log::info!(target: "node", "Version {} ({})", env!("CARGO_PKG_VERSION"), env!("GIT_HEAD")); log::info!(target: "node", "Version {} ({})", env!("CARGO_PKG_VERSION"), env!("GIT_HEAD"));
let options = Options::from_env()?;
let home = profile::home()?;
log::info!(target: "node", "Unlocking node keystore.."); log::info!(target: "node", "Unlocking node keystore..");
let home = profile::home()?;
let passphrase = term::io::passphrase(profile::env::RAD_PASSPHRASE) let passphrase = term::io::passphrase(profile::env::RAD_PASSPHRASE)
.context(format!("`{}` must be set", profile::env::RAD_PASSPHRASE))?; .context(format!("`{}` must be set", profile::env::RAD_PASSPHRASE))?;
let keystore = Keystore::new(&home.keys()); let keystore = Keystore::new(&home.keys());