From d9296b550d1142b2d10a8af0e3a18661379b38ce Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Thu, 22 Jun 2023 10:14:27 +0200 Subject: [PATCH] Improve some messages in `config auto` (#3438) --- crates/relayer-cli/src/commands/config/auto.rs | 14 ++++++-------- guide/src/documentation/commands/config.md | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/crates/relayer-cli/src/commands/config/auto.rs b/crates/relayer-cli/src/commands/config/auto.rs index 8a995e82bb..229bba7fa1 100644 --- a/crates/relayer-cli/src/commands/config/auto.rs +++ b/crates/relayer-cli/src/commands/config/auto.rs @@ -104,7 +104,7 @@ impl Runnable for AutoCmd { let chain_id = &chain_config.id; let key = find_key(chain_config); if let Some(key) = key { - info!("{}: uses key \"{}\"", &chain_id, &key); + info!("{}: uses key '{}'", &chain_id, &key); chain_config.key_name = key; } else { // If no key is found, warn the user and continue @@ -119,17 +119,15 @@ impl Runnable for AutoCmd { }; match store(&config, &self.path) { - Ok(_) => Output::success(format!( - "Config file written successfully at {}.", - self.path.to_str().unwrap() + Ok(_) => Output::success_msg(format!( + "Config file written successfully at '{}'", + self.path.display() )) .exit(), - Err(e) => Output::error(e.to_string()).exit(), + Err(e) => Output::error(e).exit(), } } - Err(e) => { - Output::error(e.to_string()).exit(); - } + Err(e) => Output::error(e).exit(), } } } diff --git a/guide/src/documentation/commands/config.md b/guide/src/documentation/commands/config.md index c7c9a1528c..2f0fed8204 100644 --- a/guide/src/documentation/commands/config.md +++ b/guide/src/documentation/commands/config.md @@ -33,7 +33,7 @@ Use `config auto` to generate a configuration file that is able to relay between 2022-08-16T17:27:27.800213Z INFO ThreadId(01) cosmoshub-4: uses key "key_cosmoshub" 2022-08-16T17:27:27.841167Z INFO ThreadId(01) osmosis-1: uses key "key_osmosis" 2022-08-16T17:27:27.841890Z WARN ThreadId(01) Gas parameters are set to default values. -SUCCESS "Config file written successfully : ~/example_config.toml." +SUCCESS Config file written successfully at '~/example_config.toml' ``` It is also possible to manually specify a key name for any chain.