Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix shell generation panic due to unnecessary 'conflicts_with' #2934

Merged
merged 2 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8> = vec![];

clap_app.gen_completions_to("solana", shell, &mut buf);

assert!(!buf.is_empty());
}
}
}
2 changes: 1 addition & 1 deletion cli/src/program_v4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ impl ProgramV4SubCommands for App<'_, '_> {
Arg::with_name("all")
.long("all")
.conflicts_with("account")
.conflicts_with("buffer_authority")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pgarg66 it's supposed to be .conflicts_with("authority"), right?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall I push up that change so we can merge this? May as well fix this

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct. It should've been the authority. Likely a copy-paste error from program.rs.
Thanks for catching it.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed the change to this PR.

.conflicts_with("authority")
.help("Show accounts for all authorities"),
)
.arg(pubkey!(
Expand Down
Loading