File tree Expand file tree Collapse file tree 2 files changed +1
-16
lines changed
Expand file tree Collapse file tree 2 files changed +1
-16
lines changed Original file line number Diff line number Diff line change @@ -27,27 +27,12 @@ async function main() {
2727 }
2828
2929 const dashIndex = process . argv . indexOf ( '--' ) ;
30- const isPowerShell = process . platform === 'win32' && process . env . PSModulePath !== undefined ;
31-
3230 if ( dashIndex !== - 1 ) {
33- // POSIX shells or explicit -- usage
3431 const completion = new PackageManagerCompletion ( packageManager ) ;
3532 await setupCompletionForPackageManager ( packageManager , completion ) ;
3633 const toComplete = process . argv . slice ( dashIndex + 1 ) ;
3734 await completion . parse ( toComplete ) ;
3835 process . exit ( 0 ) ;
39- } else if ( isPowerShell ) {
40- // PowerShell: -- was stripped, everything after 'complete' is what we want
41- const completion = new PackageManagerCompletion ( packageManager ) ;
42- await setupCompletionForPackageManager ( packageManager , completion ) ;
43- let toComplete = args . slice ( 2 ) ;
44- // In PowerShell, -- is stripped. Append empty string to simulate space at end
45- // This lets the parser know we want completions for what comes after the last arg
46- if ( toComplete . length > 0 ) {
47- toComplete = [ ...toComplete , '' ] ;
48- }
49- await completion . parse ( toComplete ) ;
50- process . exit ( 0 ) ;
5136 } else {
5237 console . error ( `Error: Expected '--' followed by command to complete` ) ;
5338 process . exit ( 1 ) ;
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ export function generate(
7575 # Split the command at the first space to separate the program and arguments.
7676 $Program, $Arguments = $Command.Split(" ", 2)
7777
78- $RequestComp = "& ${ exec } complete -- $Arguments"
78+ $RequestComp = "& ${ exec } complete '--' $Arguments"
7979 __${ name } _debug "RequestComp: $RequestComp"
8080
8181 # we cannot use $WordToComplete because it
You can’t perform that action at this time.
0 commit comments