[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 option completion (#54)

authored by

AmirHossein Sakhravi and committed by
GitHub
(Sep 23, 2025, 1:52 PM +0330) 9aba06a3 8a03ae76

+9 -8
+9 -8
src/t.ts
··· 293 293 command.options 294 294 ); 295 295 296 - this.completions = toComplete.includes('=') 297 - ? suggestions.map((s) => ({ 298 - value: `${optionName}=${s.value}`, 299 - description: s.description, 300 - })) 301 - : suggestions; 296 + this.completions = suggestions; 302 297 } 303 298 return; 304 299 } ··· 428 423 seen.add(comp.value); 429 424 return true; 430 425 }) 431 - .filter((comp) => comp.value.startsWith(toComplete)) 426 + .filter((comp) => { 427 + if (toComplete.includes('=')) { 428 + // for --option=value format, extract the value part after = 429 + const [, valueToComplete] = toComplete.split('='); 430 + return comp.value.startsWith(valueToComplete); 431 + } 432 + return comp.value.startsWith(toComplete); 433 + }) 432 434 .forEach((comp) => 433 435 console.log(`${comp.value}\t${comp.description ?? ''}`) 434 436 ); ··· 541 543 542 544 const t = new RootCommand(); 543 545 544 - // TODO: re-check the below 545 546 export function script(shell: string, name: string, executable: string) { 546 547 t.setup(name, executable, shell); 547 548 }