File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,17 @@ export class PackageManagerCompletion extends RootCommand {
105105 }
106106
107107 async parse ( args : string [ ] ) {
108- const normalizedArgs = this . stripPackageManagerCommands ( args ) ;
108+ const isPowerShell = process . platform === 'win32' && process . env . PSModulePath ;
109+ const dashIndex = process . argv . indexOf ( '--' ) ;
110+
111+ const completionArgs =
112+ dashIndex !== - 1 && ( ! isPowerShell || dashIndex < process . argv . length - 1 )
113+ ? process . argv . slice ( dashIndex + 1 )
114+ : isPowerShell
115+ ? process . argv . slice ( process . argv . indexOf ( 'complete' ) + 1 )
116+ : args ;
117+
118+ const normalizedArgs = this . stripPackageManagerCommands ( completionArgs ) ;
109119
110120 if ( normalizedArgs . length >= 1 && normalizedArgs [ 0 ] . trim ( ) !== '' ) {
111121 const potentialCliName = normalizedArgs [ 0 ] ;
You can’t perform that action at this time.
0 commit comments