[READ-ONLY] Mirror of https://github.com/bombshell-dev/tab. shell autocompletions for javascript CLIs
4

Configure Feed

Select the types of activity you want to include in your feed.

fix: root cmd completions (#22)

* fix root cmd completions

* update

authored by

AmirHossein Sakhravi and committed by
GitHub
(Apr 29, 2025, 12:32 AM +0330) d6372ae4 933535af

+5 -2
+5 -2
src/index.ts
··· 337 337 previousArgs: string[], 338 338 toComplete: string 339 339 ) { 340 - const commandParts = [...previousArgs]; 340 + const commandParts = [...previousArgs].filter(Boolean); 341 341 342 342 for (const [k, command] of this.commands) { 343 343 if (k === '') continue; 344 + 344 345 const parts = k.split(' '); 346 + 345 347 let match = true; 346 - 347 348 let i = 0; 349 + 348 350 while (i < commandParts.length) { 349 351 if (parts[i] !== commandParts[i]) { 350 352 match = false; ··· 352 354 } 353 355 i++; 354 356 } 357 + 355 358 if (match && parts[i]?.startsWith(toComplete)) { 356 359 this.completions.push({ 357 360 value: parts[i],