From f3f17ca9a178fac41513596d0af827d86864d8bb Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Mon, 31 Jan 2022 11:42:49 +0200 Subject: [PATCH] Skip config processing for the completions command (#1822) * Skip config processing for the completions command * Changelog entry for #1822 --- .../1822-skip-config-for-completions.md | 2 ++ relayer-cli/src/entry.rs | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer-cli/1822-skip-config-for-completions.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer-cli/1822-skip-config-for-completions.md b/.changelog/unreleased/bug-fixes/ibc-relayer-cli/1822-skip-config-for-completions.md new file mode 100644 index 0000000000..36eed16cc4 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer-cli/1822-skip-config-for-completions.md @@ -0,0 +1,2 @@ +- Do not require a config file to be present for the `completions` command. + ([#1822](https://github.com/informalsystems/ibc-rs/pull/1822)) diff --git a/relayer-cli/src/entry.rs b/relayer-cli/src/entry.rs index eb6eacf22e..4b535afac5 100644 --- a/relayer-cli/src/entry.rs +++ b/relayer-cli/src/entry.rs @@ -43,9 +43,13 @@ impl Runnable for EntryPoint { impl Configurable for EntryPoint { /// Path to the command's configuration file fn config_path(&self) -> Option { - // Skip config processing for the legacy `version` subcommand - if matches!(&self.command, Some(CliCmd::Version(_))) { - return None; + // Skip config processing for `completions` + // and the legacy `version` subcommand. + match &self.command { + Some(CliCmd::Completions(_)) | Some(CliCmd::Version(_)) => { + return None; + } + _ => {} } match &self.config {