Skip to content

Commit a5a13ee

Browse files
committed
check tokens
1 parent a31b10c commit a5a13ee

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

bin/package-manager-completion.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@ export class PackageManagerCompletion extends RootCommand {
129129
const knownCommands = [...this.commands.keys()];
130130

131131
if (!knownCommands.includes(potentialCliName)) {
132+
const matchesKnownPrefix = knownCommands.some((cmd) =>
133+
cmd.startsWith(potentialCliName)
134+
);
135+
136+
// If the token matches the start of a known command, let the built-in
137+
// command completion handle it instead of treating it as an external CLI.
138+
if (matchesKnownPrefix) {
139+
return super.parse(args);
140+
}
141+
132142
const cliArgs = normalizedArgs.slice(1);
133143
const suggestions = await getCliCompletions(
134144
potentialCliName,

0 commit comments

Comments
 (0)