Skip to content

Commit 11adb88

Browse files
committed
Generate shell completions for x as well
1 parent 13b77c6 commit 11adb88

File tree

5 files changed

+5941
-1
lines changed

5 files changed

+5941
-1
lines changed

src/bootstrap/src/core/config/flags.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ impl Subcommand {
622622

623623
/// Returns the shell completion for a given shell, if the result differs from the current
624624
/// content of `path`. If `path` does not exist, always returns `Some`.
625-
pub fn get_completion<G: clap_complete::Generator>(shell: G, path: &Path) -> Option<String> {
625+
pub fn get_completion<G: clap_complete::Generator + Copy>(shell: G, path: &Path) -> Option<String> {
626626
let mut cmd = Flags::command();
627627
let current = if !path.exists() {
628628
String::new()
@@ -634,6 +634,7 @@ pub fn get_completion<G: clap_complete::Generator>(shell: G, path: &Path) -> Opt
634634
};
635635
let mut buf = Vec::new();
636636
clap_complete::generate(shell, &mut cmd, "x.py", &mut buf);
637+
clap_complete::generate(shell, &mut cmd, "x", &mut buf);
637638
if buf == current.as_bytes() {
638639
return None;
639640
}

0 commit comments

Comments
 (0)