Skip to content

Commit cbed6f9

Browse files
committed
generate zsh autocompletion for x
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent 3e6d3d0 commit cbed6f9

File tree

2 files changed

+741
-2
lines changed

2 files changed

+741
-2
lines changed

Diff for: src/bootstrap/run.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,15 @@ impl Step for GenerateCompletions {
273273

274274
/// Uses `clap_complete` to generate shell completions.
275275
fn run(self, builder: &Builder<'_>) {
276-
// FIXME(clubby789): enable zsh when clap#4898 is fixed
277-
let [bash, fish, powershell] = ["x.py.sh", "x.py.fish", "x.py.ps1"]
276+
let [bash, zsh, fish, powershell] = ["x.py.sh", "x.py.zsh", "x.py.fish", "x.py.ps1"]
278277
.map(|filename| builder.src.join("src/etc/completions").join(filename));
278+
279279
if let Some(comp) = get_completion(shells::Bash, &bash) {
280280
std::fs::write(&bash, comp).expect("writing bash completion");
281281
}
282+
if let Some(comp) = get_completion(shells::Zsh, &zsh) {
283+
std::fs::write(&zsh, comp).expect("writing bash completion");
284+
}
282285
if let Some(comp) = get_completion(shells::Fish, &fish) {
283286
std::fs::write(&fish, comp).expect("writing fish completion");
284287
}

0 commit comments

Comments
 (0)