fix(cli): avoid duplicate Zsh positional completion
This commit is contained in:
parent
fe09a2e9b7
commit
6a2f9fae5f
2 changed files with 43 additions and 0 deletions
15
packages/cli/test/completions.test.ts
Normal file
15
packages/cli/test/completions.test.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { expect, test } from "bun:test"
|
||||
import path from "node:path"
|
||||
|
||||
test("zsh completion does not define the first positional twice", async () => {
|
||||
const proc = Bun.spawn([process.execPath, path.join(import.meta.dir, "../src/index.ts"), "--completions", "zsh"], {
|
||||
stdout: "pipe",
|
||||
stderr: "pipe",
|
||||
})
|
||||
const output = await new Response(proc.stdout).text()
|
||||
const error = await new Response(proc.stderr).text()
|
||||
|
||||
expect(await proc.exited, error).toBe(0)
|
||||
expect(output).toContain("'1:command:->command'")
|
||||
expect(output).not.toContain("':Directory to start OpenCode in:'")
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue