From 40c0968daa99a3be3e87d75a95f2925090eb3394 Mon Sep 17 00:00:00 2001 From: zilayo <84344709+zilayo@users.noreply.github.com> Date: Sat, 14 Sep 2024 18:52:38 +0100 Subject: [PATCH 1/2] fix: fix shell generation panic due to unnecessary 'conflicts_with' --- cli/src/cli.rs | 21 +++++++++++++++++++++ cli/src/program_v4.rs | 1 - 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/cli/src/cli.rs b/cli/src/cli.rs index 643782e418b161..b5d9f4e487d174 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -2721,4 +2721,25 @@ mod tests { } ); } + + #[test] + fn test_cli_completions() { + let mut clap_app = get_clap_app("test", "desc", "version"); + + let shells = [ + Shell::Bash, + Shell::Fish, + Shell::Zsh, + Shell::PowerShell, + Shell::Elvish, + ]; + + for shell in shells { + let mut buf: Vec = vec![]; + + clap_app.gen_completions_to("solana", shell, &mut buf); + + assert!(!buf.is_empty()); + } + } } diff --git a/cli/src/program_v4.rs b/cli/src/program_v4.rs index 917bcec52771a1..23f3a7b75cfeee 100644 --- a/cli/src/program_v4.rs +++ b/cli/src/program_v4.rs @@ -278,7 +278,6 @@ impl ProgramV4SubCommands for App<'_, '_> { Arg::with_name("all") .long("all") .conflicts_with("account") - .conflicts_with("buffer_authority") .help("Show accounts for all authorities"), ) .arg(pubkey!( From b1095f4b58c97aa5b77502789ec8de6292e73a63 Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Fri, 25 Oct 2024 18:37:21 -0700 Subject: [PATCH 2/2] Change to `conficts_with("authority")` --- cli/src/program_v4.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/src/program_v4.rs b/cli/src/program_v4.rs index 23f3a7b75cfeee..dbe2bbf6f87c0b 100644 --- a/cli/src/program_v4.rs +++ b/cli/src/program_v4.rs @@ -278,6 +278,7 @@ impl ProgramV4SubCommands for App<'_, '_> { Arg::with_name("all") .long("all") .conflicts_with("account") + .conflicts_with("authority") .help("Show accounts for all authorities"), ) .arg(pubkey!(