Skip to content

Commit b9fa951

Browse files
committed
separator
1 parent 657e684 commit b9fa951

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/cli.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ async function main() {
3131
// When PowerShell shims drop the literal '--', fall back to treating
3232
// everything after "complete" as the completion payload.
3333
const completionArgs =
34-
dashIndex !== -1
34+
// POSIX or already-present separator
35+
(dashIndex !== -1 && (!isPowerShell || dashIndex < process.argv.length - 1))
3536
? process.argv.slice(dashIndex + 1)
3637
: isPowerShell
38+
// PowerShell shims may drop the first '--' and leave only a trailing one
3739
? args.slice(2)
3840
: null;
3941

0 commit comments

Comments
 (0)