[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: wrap dashes and arguments in single quotes (#93)

authored by

Ray and committed by
GitHub
(Dec 21, 2025, 7:51 PM +0330) 88bfb2ab 71152e69

+12 -2
+5
.changeset/mean-stingrays-begin.md
··· 1 + --- 2 + '@bomb.sh/tab': patch 3 + --- 4 + 5 + fix: wrap dashes and arguments in single quotes
+4 -1
src/powershell.ts
··· 71 71 # Split the command at the first space to separate the program and arguments. 72 72 $Program, $Arguments = $Command.Split(" ", 2) 73 73 74 - $RequestComp = "& ${exec} complete -- $Arguments" 74 + $QuotedArgs = ($Arguments -split ' ' | ForEach-Object { "'" + ($_ -replace "'", "''") + "'" }) -join ' ' 75 + __${name}_debug "QuotedArgs: $QuotedArgs" 76 + 77 + $RequestComp = "& ${exec} complete '--' $QuotedArgs" 75 78 __${name}_debug "RequestComp: $RequestComp" 76 79 77 80 # we cannot use $WordToComplete because it
+3 -1
tests/shell.test.ts
··· 162 162 expect(script).toContain(`[scriptblock]$__${name}CompleterBlock =`); 163 163 164 164 // Check that the script uses the provided exec path 165 - expect(script).toContain(`$RequestComp = "& ${exec} complete --`); 165 + expect(script).toContain( 166 + `$RequestComp = "& ${exec} complete '--' $QuotedArgs"` 167 + ); 166 168 167 169 // Check that the script handles directives 168 170 expect(script).toContain(