We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a7ec8a commit b7dd1aaCopy full SHA for b7dd1aa
bin/cli.ts
@@ -41,9 +41,10 @@ async function main() {
41
const completion = new PackageManagerCompletion(packageManager);
42
await setupCompletionForPackageManager(packageManager, completion);
43
let toComplete = args.slice(2);
44
- // Only append -- if there are actual args (PowerShell stripped the trailing --)
45
- if (toComplete.length > 0) {
46
- toComplete.push('--');
+ // In PowerShell, -- is stripped. Only append it if the last arg is a flag
+ // (starts with -), meaning we want flag/option completion
+ if (toComplete.length > 0 && toComplete[toComplete.length - 1].startsWith('-')) {
47
+ toComplete = [...toComplete, '--'];
48
}
49
await completion.parse(toComplete);
50
process.exit(0);
0 commit comments