[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: should complete options after boolean option (#95)

authored by

Ray and committed by
GitHub
(Dec 21, 2025, 7:52 PM +0330) 864242b2 88bfb2ab

+16 -1
+5
.changeset/warm-pants-roll.md
··· 1 + --- 2 + '@bomb.sh/tab': patch 3 + --- 4 + 5 + fix: should complete options after boolean option
+4 -1
src/t.ts
··· 261 261 const [flag] = toComplete.split('='); 262 262 optionName = flag; 263 263 } else if (lastPrevArg?.startsWith('-')) { 264 - optionName = lastPrevArg; 264 + const option = this.findOption(command, lastPrevArg); 265 + if (option && !option.isBoolean) { 266 + optionName = lastPrevArg; 267 + } 265 268 } 266 269 267 270 if (optionName) {
+7
tests/cli.test.ts
··· 110 110 // Should complete subcommands that start with 's' even after a boolean option 111 111 expect(output).toContain('start'); 112 112 }); 113 + 114 + it('should not interfere with option completion after boolean options', async () => { 115 + const command = `${commandPrefix} dev --verbose --h`; 116 + const output = await runCommand(command); 117 + // Should complete subcommands that start with 's' even after a boolean option 118 + expect(output).toContain('--host'); 119 + }); 113 120 }); 114 121 115 122 describe.runIf(!shouldSkipTest)('option API overload tests', () => {