Skip to content

Commit

Permalink
fix: use stderr for cli messages (#4022)
Browse files Browse the repository at this point in the history
  • Loading branch information
dandanlen committed Sep 21, 2023
1 parent 285a04d commit d40c482
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions api/bin/chainflip-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,11 @@ fn generate_keys(json: bool, path: Option<PathBuf>, seed_phrase: Option<String>)
if json {
println!("{}", serde_json::to_string_pretty(&keys)?);
} else {
println!();
println!("Generated fresh Validator keys for your Chainflip Node!");
println!();
println!("{}", keys);
println!("{}", DISCLAIMER);
eprintln!();
eprintln!("Generated fresh Validator keys for your Chainflip Node!");
eprintln!();
eprintln!("{}", keys);
eprintln!("{}", DISCLAIMER);
}

if let Some(path) = path {
Expand All @@ -348,12 +348,14 @@ fn generate_keys(json: bool, path: Option<PathBuf>, seed_phrase: Option<String>)
.context("Error while writing to file.")?;
}

println!();
println!("💾 Saved all secret keys to '{}'.", path.display());
} else if !json {
println!();
println!("💡 You can save the private key files to a directory using the --path argument:");
println!("💡 `chainflip-cli --seed-phrase $MY_SEED_PHRASE --path $PATH_TO_KEYS_DIR`");
eprintln!();
eprintln!(" 💾 Saved all secret keys to '{}'.", path.display());
} else {
eprintln!();
eprintln!(
"💡 You can save the private key files to a directory using the --path argument:"
);
eprintln!("💡 `chainflip-cli --seed-phrase $MY_SEED_PHRASE --path $PATH_TO_KEYS_DIR`");
}

Ok(())
Expand Down

0 comments on commit d40c482

Please sign in to comment.